• 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: String Encodings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String Encodings


  • Subject: Re: String Encodings
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 8 Dec 2007 19:35:53 -0600


On Dec 8, 2007, at 7:11 PM, John Nairn wrote:

Converting an NSString to NSData specifies an encoding, but is there a way to write one's own encoding rather than use the available ones?

I found the encoding called NSProprietaryStringEncoding for "installation s-ecific encodings," but I can not find a way to code how my installation would handle characters in the string?

My need it to convert Unicode to ANSEL, which is a character set (nearly obsolete) found in many GEDCOM genealogy files.


Keep in mind that ANSEL (aka ALA/MARC8) cannot fully represent Unicode and will thus be lossy depending upon the Unicode input. Going from ANSEL to Unicode would not be lossy in that direction.

At my day job, we just implemented our own routine to go from Unicode <--> ANSEL. We chose to use the '?' character in cases where a Unicode code point couldn't be represented. All files that ended up in ANSEL encoding were then treated as binary files (i.e. no string translations were performed). We always fed the bytes into our conversion routine and ended up with UTF-16 strings.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >String Encodings (From: John Nairn <email@hidden>)

  • Prev by Date: String Encodings
  • Next by Date: Re: GC Drawer Madness
  • Previous by thread: String Encodings
  • Next by thread: Debugger exits with signal 5 (SIGTRAP) after computer crashed.
  • Index(es):
    • Date
    • Thread