• 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 and Unicode and Japanese character encodings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString and Unicode and Japanese character encodings


  • Subject: NSString and Unicode and Japanese character encodings
  • From: Izidor Jerebic <email@hidden>
  • Date: Thu, 25 Aug 2005 21:33:37 +0200


Much to my big surprise I read on Ruby mailing list that Unicode is not appropriate for general character encoding, in particular it fails to support existing Japanese encodings, among other problems.


One of the problems is that Japanese Shift-JIS encoding does not map one-to-one to Unicode. There are Shift-JIS codes that do not survive round-trip to Unicode and back to Shift-JIS - you get back a different one than the starting one.

There are some pages describing this (and other) problems in Japanese encodings:
<http://support.microsoft.com/default.aspx?scid=kb;en-us;Q170559>
<http://www.miraclelinux.com/english/technet/samba30/iconv_issues.html>


My question is: do NSString and NSText cope with this? Is it safe to use NSString and assume that using initWithData:encoding: and then modifying that string (e.g. inserting something) and than using dataUsingEncoding: will get me back the same characters if encoding is Shift-JIS?

If they convert internally to Unicode, we have a problem. Or not?

And obviously we are not supposed to extract and insert Unicode chars, but only NSStrings (using substringWithRange: methods)? Or what?

Anybody?


izidor

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString and Unicode and Japanese character encodings
      • From: Satoshi Matsumoto <email@hidden>
    • Re: NSString and Unicode and Japanese character encodings
      • From: Aki Inoue <email@hidden>
    • Re: NSString and Unicode and Japanese character encodings
      • From: John Stiles <email@hidden>
    • Low-Level Cocoa Typography
      • From: Dean Snyder <email@hidden>
  • Prev by Date: Re: Alloc Mocks my World
  • Next by Date: Where are the header files ?
  • Previous by thread: InstantMessage Framework problem
  • Next by thread: Low-Level Cocoa Typography
  • Index(es):
    • Date
    • Thread