
Using Boost.Locale you can convert to locale encoding of a given
std::locale() object generated with Boost.Locale.
boost::locale::generator allows to select legacy "ANSI" encoding instead of UTF-8 to be default upon creation of the locale object that corresponds to the system locale.
This object you can use with to_utf and from_utf functions.
Unfortunately that does not work under Microsoft Windows as generator locale_generator ; locale_generator.use_ansi_encoding( true ) ; std::locale const current_locale = locale_generator.generate( name ) ; needs a name.
Similar to creating std::locale("") the generation locale_generator.generate("") gives the expected result, i.e. system default locale. See: http://www.boost.org/doc/libs/1_51_0/libs/locale/doc/html/locale_gen.html
Best regards
Bjoern.
Regards Artyom Beilis