Re: String Encodings
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