Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost 1.49 Locale Conversion failed
From: NtVisigoth (ntvisigoth_at_[hidden])
Date: 2012-07-11 07:45:15


2012/7/11 <Viatcheslav.Sysoltsev_at_[hidden]>

> On Tue, 10 Jul 2012 16:17:30 +0200, NtVisigoth <ntvisigoth_at_[hidden]>
> wrote:
>
>>
>> I written another proba-project:
>>
>> const std::string strLanguagesPath(
>> "g:\\source\\boost_locale\\**languages\\" );
>> const std::string strLanguageFilename( "messages" );
>> const std::string strEnLanguage( "en_US.UTF-8" );
>> const std::string strRuLanguage( "ru_RU.UTF-8" );
>>
>> int main( int argc, char * argv[] )
>> {
>> using namespace std;
>> using namespace boost::locale;
>>
>> int exitCode = EXIT_SUCCESS;
>> try
>> {
>> generator gen;
>>
>> gen.add_messages_path( strLanguagesPath );
>> gen.add_messages_domain( strLanguageFilename );
>>
>> cout << "Start Boost.Locale proba" << endl;
>> std::locale en_loc = gen( strEnLanguage );
>> wcout << TREX( L"hello world", en_loc ) << endl;
>>
>> std::locale ru_loc = gen( strRuLanguage );
>> wcout << TREX( L"hello world", ru_loc ) << endl;
>> cout << "Stop Boost.Locale proba" << endl;
>>
>>
> Hi,
>
> I have very little experience with locales, but would note few things here:
>
> 1) You're using wcout for UTF-8 - that's not legal, at least in gcc world
> (have no dev win machine under hand)
>
> 2) what's TREX macro? Please always provide full test case.
>
> 3) May it be that your console cannot output non-ASCII symbols? Look at
> the string in debugger just to be sure.
>
> -- Slava
>
>
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>

2) I am sorry. I use next macroses:
#define TR(S) boost::locale::translate(S)
#define TREX(S,L) boost::locale::translate(S).str(L)

3) You are right! See:
c:\>chcp
Active code page: 866



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net