This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to set locale with C++


On Feb  9 12:13, marco atzeri wrote:
> Attached a small example taken from Bruce Eckel Thinking in C++
> 
> On cygwin both this call
> 
>   cout.imbue(locale("en_US.UTF-8"));
> 
>   cout.imbue(locale("fr_FR.UTF-8"));
> 
> raise exception
> 
> "terminate called after throwing an instance of 'std::runtime_error'
>   what():  locale::facet::_S_create_c_locale name not valid
> Aborted (core dumped)"
> 
> I could understand eventually the second one, but "English (US)" is
> the current windows locale so I expected that at least "en_US.UTF-8"
> is accepted.
> 
> What I am missing ?

This doesn't look like a Cygwin issue.  The above error
"locale::facet::_S_create_c_locale name not valid" points to some
problem in the library implementing the locale call.  The underlying
plain C call setlocale should work fine.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]