NSString really Unicode?
NSString really Unicode?
- Subject: NSString really Unicode?
- From: "James J. Merkel" <email@hidden>
- Date: Wed, 10 Mar 2004 22:16:22 -0800
The documentation for NSString says:
"A string object presents itself as an array of Unicode characters
(Unicode is a registered trademark of Unicode, Inc.)."
I am reading a file that has strings of 16-bit Unicode characters. The
low byte of a character is an ASCII character and the high byte is 0,
and the strings are 0 terminated. If I read one of these strings into
an NSString and then send it out to an NSTextField it displays
correctly. However, I can't do much else with it. For example if I try
an -intValue, as soon as the first 0 is hit the conversion stops. Also
I can't use isEqualToString. I got around the -intValue problem by
converting the string to a C string and then using atoi. But this seems
kind of lame. Am I missing something regarding NSString?
TIA,
Jim Merkel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.