Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wchar_t and printf not working



On 28.03.2005 12:51, "Michael B Allen" <email@hidden> wrote:

>>   More precisely, between 1 and 4:
>> <http://www.unicode.org/faq/utf_bom.html#30>.
> 
> At risk of being pedantic this is just talking about how to convert a
> UTF-16 character into a UTF-8 one.

  That's because the only imaginable way to come up with something that
looks similar to a 6-byte UTF-8 used to be an incorrect conversion from
UTF-16 :)

> Because UTF-16 with a surrogate can
> only represent 21 bits of the Unicode code space only 4 bytes is necessary
> to encode any character in UTF-8. But UTF-8 can encode the full 31 bit
> code space which needs at most 6 bytes to be represented in UTF-8. But
> unless you're doing Klingon you'll never actually see more than 4.

  Actually, the Unicode code space is currently not 32 or 31 bits, it's
0...10FFFF (of which most codes are unassigned, but that's another topic):
<http://www.unicode.org/faq/utf_bom.html#9>. The FAQ also explicitly states
that UTF-8 needs 4 bytes as a maximum. AFAIK, there's no official guarantee
that a future version of Unicode won't extend the code space yet, but such a
guarantee is being considered.

  Aren't we too offtopic now? And after all, I'm mostly citing a single page
of the Unicode FAQ, which anyone interested can and should read.

- WBR, Alexey Proskuryakov


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: wchar_t and printf not working (From: Michael B Allen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.