[cfe-dev] [cfe-commits] [PATCH] pretty display of unprintable source and correct caret/range/fixup alignment

Joerg Sonnenberger joerg at britannica.bec.de
Mon Apr 16 03:38:29 PDT 2012


On Sun, Apr 15, 2012 at 07:56:12PM -0400, Seth Cantrell wrote:
> But I do have to convert from UTF-8 to the host's wchar_t encoding in
> order to use these functions. Currently I'm creating a locale where
> the narrow character encoding is UTF-8 so I can convert from UTF-8 to
> the wchar_t encoding. And since I go ahead and use that for the other
> locale based functions. I could assume that the wchar_t is UTF-16 or
> UTF-32 depending on the sizeof(wchar_t), and use the ConvertUTF8ToUTFXX
> functions. As far as I know this holds for the platforms we care about.

It is not a portable assumption. At least NetBSD explicitly does not
make any such promise, since it can lose information. You can assume it
iff __STDC_ISO_10646__ is defined.

Joerg



More information about the cfe-dev mailing list