
________________________________________ From: boost-bounces@lists.boost.org [boost-bounces@lists.boost.org] on behalf of Artyom Beilis [artyomtnk@yahoo.com] Sent: Thursday, November 01, 2012 09:57 To: boost@lists.boost.org Subject: Re: [boost] [locale] [filesystem] Windows local 8 bit encoding
________________________________ From: "Thiel, Bjoern" <bjoern.thiel <at> mpibpc.mpg.de> To: "boost <at> lists.boost.org" <boost <at> lists.boost.org> Sent: Wednesday, October 31, 2012 4:07 PM Subject: [boost] [locale] [filesystem] Windows local 8 bit encoding
Hi Artyom,
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.
Right - you can use them. But they are not very helpful. If you want the SYSTEM locale on Microsoft Windows: generator locale_generator ; locale_generator.use_ansi_encoding( true ) ; wstring = conv::to_utf< wchar_t >( string, locale_generator( "" ) ) ; unfortunately gives UTF-8 encoding as well. And if you want the CURRENT locale on Microsoft Windows, I simply can't see how to get that. But why not add generator.generate( void ) giving exactly that. Together with 'really' use_ansi_encoding( true ) it would be perfect. Best regards Bjoern.