From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17216 invoked from network); 30 Nov 2020 12:40:54 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2020 12:40:54 -0000 Received: (qmail 1569 invoked by uid 550); 30 Nov 2020 12:40:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1548 invoked from network); 30 Nov 2020 12:40:51 -0000 X-Virus-Scanned: Debian amavisd-new at disroot.org Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1606740035; bh=TNrFOg31OXVixw9iinqN1CiKKMqo7039VYSFCEm/K68=; h=To:Subject:From:Date:In-Reply-To; b=IXMyPgakR+APJ3qFAgbcVpTj451indNVYYztRDVBLrnBTU0AmyseEz55Bx5AcNH8G 2C8eEayHEQApFGj4baNj1rvI2sfJLQOBzQ4AhdxD9kabxDHT156nYWIH5oVqsvebxn Y5yBqWuEQP7NGdSD8BXwNLEMaDZyYKLqGUNWxN0+WEpvlY854cbAwUkjQkyu0ULgar HwlNTw1NOZmYEKDu+RHnUOa42FKQuuOjXBK8My1IMeUvSoixflKR/z8Q3JF0M5a6TT sNCyOWYPmwh49vuecgRJU0FaVZwlFFNs8Ebp/xFiaJslJSefBzAqptQ7w7WSejUnng oONwZxQ61g/Zg== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 To: , "Dong Brett" From: =?utf-8?q?=C3=89rico_Nogueira?= Date: Mon, 30 Nov 2020 09:37:47 -0300 Message-Id: In-Reply-To: <20201130113508.GQ1370092@port70.net> Subject: Re: [musl] Question on C++ locale On Mon Nov 30, 2020 at 8:35 AM -03, Szabolcs Nagy wrote: > * Dong Brett [2020-11-30 18:41:33 > +0800]: > > However, the following C++ code does not work (our software uses std::l= ocale in C++ standard library for locale related stuff): > > #include > > #include > > #include > > using namespace std; > > int main() > > { > > std::locale::global(locale("")); > > initscr(); > > printw("LC_ALL: %s\n", setlocale(LC_ALL, NULL)); > > printw("C++ locale: %s\n", locale().name().c_str()); > > printw("CODESET: %s\n", nl_langinfo(CODESET)); > > printw("Hello, world!\n"); > > printw("=E4=BD=A0=E5=A5=BD=EF=BC=8C=E4=B8=96=E7=95=8C!\n"); > > refresh(); > > getch(); > > endwin(); > > return 0; > > } > > fwiw for me even the first line fails. > i don't know how c++ locales are supposed to work. > > $ cat a.cc > #include > using namespace std; > int main() > { > std::locale::global(locale("")); > return 0; > } > > $ g++ a.cc > $ ./a.out > terminate called after throwing an instance of 'std::runtime_error' > what(): locale::facet::_S_create_c_locale name not valid > Aborted For an example of this issue "in the wild", so to speak, I can only launch supertux2 [1] with LANG=3DC. Exact same error message otherwise. - [1] https://github.com/SuperTux/supertux