Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 16 Oct 2015 10:32:38 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Locale Support For MUSL

On Fri, Oct 16, 2015 at 03:50:18PM +0800, Kevin Cheung wrote:
> Hi,
> 
> Does MUSL support locales other than C.UTF-8 and C?
> 
> I tried the following code on Emscripten which uses MUSL:

I would say Emscripten "reuses musl code", rather than "uses musl".
I'm not sure exactly the current status of how much they use, but I
think it's likely that Emscripten is not doing locale.

> locale = std::setlocale(LC_NUMERIC, "de_DE");
> std::cout << "locale:" << locale << std::endl;
> 
> and the locale returned was C.UTF-8. Is there anyway in which we can use
> different locals in MUSL?

The only thing that would be affected by LC_NUMERIC is "." vs "," as
the radix point, and musl explicitly does not support changing radix
point. There's an old mailing list thread on this topic you can look
up; I think it's part of the one called "Locale bikeshed time". So
even if you do have full musl, changing LC_NUMERIC won't do much.
Older versions of musl (before 1.1.10 I think) will always show
"C.UTF-8" for LC_NUMERIC. Newer versions let you change it for the
sake of programs that use dcgettext() with LC_NUMERIC, so you will see
the change, but it doesn't do anything except affect the message files
dcgettext would use when you pass LC_NUMERIC (a really unusual usage
case).

Does setting LC_MESSAGES work? If so the issue is probably that
Emscripten's musl is just a bit old. Otherwise, Emscripten probably
just lacks the locale functionality.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.