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.3 required=5.0 tests=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 8759 invoked from network); 30 Nov 2020 11:35:26 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2020 11:35:26 -0000 Received: (qmail 20345 invoked by uid 550); 30 Nov 2020 11:35:22 -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 20326 invoked from network); 30 Nov 2020 11:35:22 -0000 Date: Mon, 30 Nov 2020 12:35:08 +0100 From: Szabolcs Nagy To: Dong Brett Cc: musl@lists.openwall.com Message-ID: <20201130113508.GQ1370092@port70.net> Mail-Followup-To: Dong Brett , musl@lists.openwall.com References: <62BA8BC9-9943-418A-8349-2B1FB962EDE9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <62BA8BC9-9943-418A-8349-2B1FB962EDE9@gmail.com> Subject: Re: [musl] Question on C++ locale * Dong Brett [2020-11-30 18:41:33 +0800]: > However, the following C++ code does not work (our software uses std::loc= ale 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=20 terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Aborted