Artyom Beilis wrote:
bool is_valid_utf8( string const & s ); wstring utf8_decode( string const & s ); string utf8_encode( wstring const & s );
See, all this is already implemented in header only way in Boost.Locale - so no linking required.
https://github.com/boostorg/locale/blob/master/include/boost/locale/utf.hpp https://github.com/boostorg/locale/blob/master/include/boost/locale/encoding...
So just call boost::locale::conv::utf_to_utf
("Hello World");
That's nice. I'd prefer UTF-8 support to not be tied to locales as it's more fundamental, but you have basically anticipated that and made Nowide, which is exactly what I need on a day-to-day basis - support for UTF-8 as the ubiquitous external encoding. Nowide however spells those functions in a different way, nowide::widen and nowide::narrow. One issue is that these functions are not immediately discoverable, in either place. One would expect UTF-8 functions to be in a library having UTF-8 in the name, or for the functions to have utf8 in their names.