Re:UTF-8 good, UTF-16 bad
by program on Tuesday February 08, 2011 @03:35AM
(#2192393)
Strings are big-endian UTF-16 by default even in Cocoa (stored in an array of unsigned shorts). Worst of all GCC define the wchar_t as a 4 byte int unless you specify -fshort-wchar.
[ Parent
| on HN ]
As far as I know, wchar_t is meant to be an internal only representation, so it's good that it is 32 bits--that way you are in one codepoint per word territory. It's a mistake to think you can just overlay some unicode binary data with a wchar_t pointer--you need to convert into and out of wchat_t from utf8/utf-16/whatever. Otherwise you aren't handling codepoints above 16 bits correctly.
Re:UTF-8 good, UTF-16 bad
by fauigerzigerk on Tuesday February 08, 2011 @08:40AM
(#2192795)
Unfortunately the size of wchar_t is platform/compiler dependent.