delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/09/07:35:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4F33AA60.6080704@gmail.com>
References: <4F33AA60 DOT 6080704 AT gmail DOT com>
Date: Thu, 9 Feb 2012 13:35:17 +0100
Message-ID: <CAKw7uVinYP+WCgRfr9CwqRx8qiKE2Y86QaTswLhV5a=XLGFtWQ@mail.gmail.com>
Subject: Re: how to set locale with C++
From: =?UTF-8?Q?V=C3=A1clav_Zeman?= <vhaisman AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q19CZcMR021942

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019