• 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
Re: NSString creating problem when contains chinese font
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString creating problem when contains chinese font


  • Subject: Re: NSString creating problem when contains chinese font
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Wed, 1 Oct 2003 21:01:00 +0200

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.

  • Follow-Ups:
    • Re: NSString creating problem when contains chinese font
      • From: Calvin Hou <email@hidden>
    • Re: NSString creating problem when contains chinese font
      • From: Calvin Hou <email@hidden>
References: 
 >Re: NSString creating problem when contains chinese font (From: Calvin Hou <email@hidden>)

  • Prev by Date: Re: NSString creating problem when contains chinese font
  • Next by Date: Shell script problem (PB)
  • Previous by thread: Re: NSString creating problem when contains chinese font
  • Next by thread: Re: NSString creating problem when contains chinese font
  • Index(es):
    • Date
    • Thread