
I didn't notice this thread earlierlemonyii wrote:but why don't you tell me earlier?

I didn't notice this thread earlierlemonyii wrote:but why don't you tell me earlier?
I'm sorry but that's just plain wrongOwen wrote:Important note: short wchar is not conforming to the C standard
ISO C99 standard wrote:wchar_t
which is an integer type whose range of values can represent distinct codes for all
members of the largest extended character set specified among the supported locales; the
null character shall have the code value zero.
16 bits cannot represent all Unicode characters - the minimum integer size capable of doing so is 22-bit (and therefore minimum practical size is 32-bit)ISO C99 standard wrote:wchar_t
which is an integer type whose range of values can represent distinct codes for all
members of the largest extended character set specified among the supported locales; the
null character shall have the code value zero.
UTF-16 can, though I understand that UTF-16 does not confrom to the C standard.Owen wrote:16 bits cannot represent all Unicode characters - the minimum integer size capable of doing so is 22-bit (and therefore minimum practical size is 32-bit)
i support the first part of this sentence,but not the latter part.UTF-16 can, though I understand that UTF-16 does not confrom to the C standard.
The OP is Chinese. A significant quantity of CJK characters (40,000) are in the Supplementary Ideographic Plane. These characters, while not common, do crop up often (Particularly in names)Combuster wrote:Never heard of Unicode 3.0?
Point here is, 16-bit unicode supports more than you'll find being used in your OS (at least, for those who lack asian influences). And I think you might want to be a bit more careful with stating popular belief as fact. The world isn't that black and white.
The onboard toolbox of C99 does not allow for proper and full support of locales, no matter what you define wchar_t to or whether you support unicode.Owen wrote:OK, so you're declaring your supported locales to not include Unicode?
Have fun with that. (Particularly when UTF-16/32 are most likely going to be incorporated into C1X)
Code: Select all
toupper( 'ß' );
I never said that C's Unicode handling was sane; much to the contrary. There is also the issue that for many locales "upper" and "lower" cases make no sense!Solar wrote:The onboard toolbox of C99 does not allow for proper and full support of locales, no matter what you define wchar_t to or whether you support unicode.Owen wrote:OK, so you're declaring your supported locales to not include Unicode?
Have fun with that. (Particularly when UTF-16/32 are most likely going to be incorporated into C1X)
Point in case:
Correct answer would be "SS", but toupper() (as well as it's wide counterpart towupper()) can only return one character.Code: Select all
toupper( 'ß' );
I am sure there are more examples in other languages.
I'm looking forward to C1X introducting Unicode support into the standard, but you can only get that close with C99.