| www.delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| Date: | Thu, 9 Feb 2012 13:37:38 +0100 |
| From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: how to set locale with C++ |
| Message-ID: | <20120209123738.GG23330@calimero.vinschen.de> |
| Reply-To: | cygwin AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| References: | <4F33AA60 DOT 6080704 AT gmail DOT com> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <4F33AA60.6080704@gmail.com> |
| User-Agent: | Mutt/1.5.21 (2010-09-15) |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |