Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost 1.49 Locale Conversion failed
From: Viatcheslav.Sysoltsev_at_[hidden]
Date: 2012-07-11 07:41:02


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 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