From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dmta0013.nifty.com (mta-snd00007.nifty.com [106.153.226.39]) by sourceware.org (Postfix) with ESMTPS id A164A3858D39 for ; Thu, 21 Sep 2023 16:28:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A164A3858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 by dmta0013.nifty.com with ESMTP id <20230921162855582.LURK.43072.HP-Z230@nifty.com> for ; Fri, 22 Sep 2023 01:28:55 +0900 Date: Fri, 22 Sep 2023 01:28:56 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: std::runtime_error on std::locale("") Message-Id: <20230922012856.47872090281f2a303fd7b99f@nifty.ne.jp> In-Reply-To: <20230922011204.bb166498090e6cbe163349f3@nifty.ne.jp> References: <20230922011204.bb166498090e6cbe163349f3@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 22 Sep 2023 01:12:04 +0900 Takashi Yano wrote: > I wonder why the following code throws std::runtime_error > even though the LC_ALL is set to valid locale other than "C". > This does not occur only when LC_ALL is set to "C". > > #include > int main() > { > std::locale(""); > return 0; > } > > In linux, this occurs only when the LC_ALL is set to invalid > locale (i.e. locale that is not registered in system). Similarly, std::locale("ja_JP.UTF-8") throws std::runtime_error in cygwin. -- Takashi Yano