Convert between string, u16string and u32string using libstdc ++

I found this topic Converting between a string, u16string and u32string , and the solution (which looks really great) only works with libC ++, not libstdC ++. Currently, lib ++ is not used - it is difficult to compile and does not work well on Windows.

Is there any method for converting between these views using C ++ 11 and libstdC ++ that works on all platforms?

I am particularly interested in converting u32_string to a string (utf8) and vice versa.

+5
source share
2 answers

++ 11 , wstring_convert.

, , libstd++ ( gcc 4.8)

:

codecvt<char16_t, char, mbstate_t>.
codecvt<char32_t, char, mbstate_t>.
codecvt_utf8.
codecvt_utf16.
codecvt_utf8_utf16.

<codecvt> - gcc.

+2
0

All Articles