Re: NSString creating problem when contains chinese font
Re: NSString creating problem when contains chinese font
- Subject: Re: NSString creating problem when contains chinese font
- From: Calvin Hou <email@hidden>
- Date: Wed, 01 Oct 2003 17:32:11 -0400
I've tried some possible encodings, if not modifying the contents, only the
UTF8 can make both the English(ASCII) and Chinese displayed correctly for
now.
I'm also worrying about it's because of the encoding. I'll check out with
unicode.org.
By the way, the text file contains the string is from linux system.
Thank you Uli.
Calvin
>
From: "M. Uli Kusterer" <email@hidden>
>
Date: Wed, 1 Oct 2003 21:01:00 +0200
>
To: Calvin Hou <email@hidden>, <email@hidden>
>
Subject: Re: NSString creating problem when contains chinese font
>
>
At 14:22 Uhr -0400 01.10.2003, Calvin Hou wrote:
>
> The Chinese code uses 2 byte for one Chinese character. Each byte in greater
>
> than 0x80.
>
>
This is true for UTF16 and Shift-JIS and many other formats used for
>
representing Japanese and Chinese characters, however it is not
>
guaranteed for UTF8. If you really get the correct string (and not
>
just other Chinese or Korean or whatever characters) then you're
>
simply lucky.
>
>
> If I don't modify the Chinese character in the contents[], the NSString is
>
> created correctly, and all of the ASCII and Chinese in the string is
>
> displayed correctly. So I think the USF8 is suitable for what read from the
>
> file.
>
>
It shouldn't be. Which means you really should read up on UTF8 on
>
unicode.org, as well as find out what format your string is actually
>
in. Whatever it is, I doubt it's UTF8.
>
>
Though, as I said, I'm no Unicode pro. But that's how I understood
>
it from docs like <http://www.skytag.com/developer/>.
>
>
Very likely you're using the wrong encoding for your text. So, you
>
just need to find the right one.
>
>
PS - Uli is just fine. Kusterer's my last name. :-)
>
--
>
Cheers,
>
M. Uli Kusterer
>
------------------------------------------------------------
>
"The Witnesses of TeachText are everywhere..."
>
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.