I found this topic Convert between string, u16string & u32string and the solution (which looks really great) works only using libc++ not libstdc++. Currently libc++ is not usable - it is hard to compile and dont work good on Windows.
Is there any method to convert between these representations using C++11 and libstdc++, which works on all platforms?
I'm especially interested in converting u32_string to string (utf8) and vice versa.
There is a way portable way in C++11 to do this through the wstring_convert class.
However, it seems that it is not yet implemented libstdc++ (as of gcc 4.8)
The same applies to:
codecvt<char16_t, char, mbstate_t>.
codecvt<char32_t, char, mbstate_t>.
codecvt_utf8.
codecvt_utf16.
codecvt_utf8_utf16.
In fact the header <codecvt>
is still not present in the gcc distribution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With