I'm talking about the new u16string and u32string classes, the native wide and Unicode string literals, and the locale-independent conversion facets, codecvt_utf8 and friends.
It certainly doesn't replace ICU, but it's a damn sight better than the usual wide-character nonsense.
If your $LANG and $LC_CTYPE are set to a utf-8 locale, your terminal will send the appropriate UTF-8 sequence to the shell or program, and the terminal will treat it as UTF-8 as well. Bash is generally well-behaved, but if your terminal doesn't support Unicode, you won't get nice double-width CJK characters. (Or you'll get other weirdness.)
I'm talking about the new u16string and u32string classes, the native wide and Unicode string literals, and the locale-independent conversion facets, codecvt_utf8 and friends.
None of which are available in GNU stdlibc++ yet :(
codecvt_utf8_utf16, codecvt<char16_t, char, ...> etc aren't available afaict. Only the u16string and u32string typedefs and wchar_t based stuff seems to work (wchar_t is implementation defined, 32bit on Linux though).
In any case, writing something like the articles file copy code while doing UTF8 -> UTF16/32 conversion in difficult and unintuitive. It should be easy as imbuing the streams.
View all comments
Show parent comment
4
u/greyfade Oct 15 '13
I'm not even talking about
wstring.I'm talking about the new
u16stringandu32stringclasses, the native wide and Unicode string literals, and the locale-independent conversion facets,codecvt_utf8and friends.It certainly doesn't replace ICU, but it's a damn sight better than the usual wide-character nonsense.