NSString and Unicode and Japanese character encodings
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