• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSString really Unicode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: NSString really Unicode?
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Re: Thread safety of NSPipe
  • Next by Date: Re: NSMenuItem <protocol>
  • Previous by thread: Force instant re-display after scrollRectToVisible
  • Next by thread: Re: NSString really Unicode?
  • Index(es):
    • Date
    • Thread