This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: how to set locale with C++
- From: VÃclav Zeman <vhaisman at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 9 Feb 2012 13:35:17 +0100
- Subject: Re: how to set locale with C++
- References: <4F33AA60.6080704@gmail.com>
On 9 February 2012 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)"
This is GCC/libstdc++ problem. Libstdc++ implements std::locale
depending on OS capabilities. AFAIK the only well working
implementation is the one using GNU locale extension functions. That
pretty much limits well working locale to Glibc targets.
>
> 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 ?
--
VZ
--
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