1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Description: Implement -cString and -UTF8String.
This is required so that [(CFStringRef)str UTF8String] works. It got
broken upstream when CFString was rewritten in C.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2024-09-26
---
--- gnustep-corebase-0.1.1+20230710.orig/Source/NSCFString.m
+++ gnustep-corebase-0.1.1+20230710/Source/NSCFString.m
@@ -195,6 +195,16 @@
return (NSUInteger)CFStringGetLength ((CFStringRef) self);
}
+- (const char *) UTF8String
+{
+ return CFStringGetCStringPtr ((CFStringRef) self, kCFStringEncodingUTF8);
+}
+
+- (const char *) cString
+{
+ return CFStringGetCStringPtr ((CFStringRef) self, kCFStringEncodingASCII);
+}
+
- (unichar) characterAtIndex: (NSUInteger) index
{
return (unichar)CFStringGetCharacterAtIndex ((CFStringRef) self, index);
|