• 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
Re: NSString really Unicode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString really Unicode?


  • Subject: Re: NSString really Unicode?
  • From: "James J. Merkel" <email@hidden>
  • Date: Fri, 12 Mar 2004 19:47:44 -0800

After I wrote the e-mail I realized that wasn't the right way to do it. All I need to do is convert the key from little endian to big endian and then use that key to access the data structure from the Localizable.strings file.

Thanks for your help.
Jim Merkel

On Mar 12, 2004, at 9:59 AM, Dustin Voss wrote:

On 12 Mar, 2004, at 8:47 AM, James J. Merkel wrote:

This brings up another question -- what I'm really looking at are key-value pairs in the file. What I would like to to is use the key to look up a string in a Localizable.strings file. However, I notice that if I use UTF-16 encoding for the Localizable.strings file, the strings are big endian format. Is there a way of making this file little endian format?

It wouldn't do any good. You don't look up keys in the Localizable.strings file directly; you look up keys in a data structure that is created from the file. They are already in NSString's internal format when you try to look them up.

However, you may be able to make a lookup table of your own by turning an NSDictionary into a plist file, where the dictionary values are the strings you want, and the dictionary keys are the raw NSData forms of the camera file's keys.

If it is any consolation, I logged an enhancement request (#3364697) a long time ago for Apple to add some endian-aware encodings: NSUnicodeLEStringEncoding, NSUnicodeBEStringEncoding, kCFStringEncodingUnicodeLE, and kCFStringEncodingUnicodeBE. These would not use a BOM when converting data-to-string, and would not create a BOM when converting string-to-data. It was marked as a duplicate and closed, so maybe they will actually implement it someday. Feel free to log the same bug to speed up the schedule. :)
_______________________________________________
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.


References: 
 >NSString really Unicode? (From: "James J. Merkel" <email@hidden>)
 >Re: NSString really Unicode? (From: "M. Uli Kusterer" <email@hidden>)
 >Re: NSString really Unicode? (From: "James J. Merkel" <email@hidden>)
 >Re: NSString really Unicode? (From: Allan Odgaard <email@hidden>)
 >Re: NSString really Unicode? (From: "James J. Merkel" <email@hidden>)
 >Re: NSString really Unicode? (From: Shawn Erickson <email@hidden>)
 >Re: NSString really Unicode? (From: "James J. Merkel" <email@hidden>)
 >Re: NSString really Unicode? (From: Dustin Voss <email@hidden>)

  • Prev by Date: OT: /tmp vanished!
  • Next by Date: Re: problems with including a framework
  • Previous by thread: Re: NSString really Unicode?
  • Next by thread: Re: NSString really Unicode?
  • Index(es):
    • Date
    • Thread