String Encodings

  • 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.

    ---------------
    John Nairn (1-541-737-4265, FAX:1-541-737-3385)
    Professor and Richardson Chair
    Web Page: http://woodscience.oregonstate.edu/faculty/nairn.php (under
    construction)
    FEA/MPM Web Page: http://oregonstate.edu/~nairnj
  • 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:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today