|
Boost : |
Subject: Re: [boost] [locale] [filesystem] Windows local 8 bit encoding
From: Thiel, Bjoern (bjoern.thiel_at_[hidden])
Date: 2012-11-06 05:47:53
________________________________________
From: boost-bounces_at_[hidden] [boost-bounces_at_[hidden]] on behalf of Artyom Beilis [artyomtnk_at_[hidden]]
Sent: Thursday, November 01, 2012 09:57
To: boost_at_[hidden]
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk