mailing list of musl libc
 help / color / mirror / code / Atom feed
* Locale Support For MUSL
@ 2015-10-16  7:50 Kevin Cheung
  2015-10-16 14:32 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cheung @ 2015-10-16  7:50 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

Hi,

Does MUSL support locales other than C.UTF-8 and C?

I tried the following code on Emscripten which uses MUSL:

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?

-- 
In His grace,
Kevin Cheung

[-- Attachment #2: Type: text/html, Size: 753 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Locale Support For MUSL
  2015-10-16  7:50 Locale Support For MUSL Kevin Cheung
@ 2015-10-16 14:32 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2015-10-16 14:32 UTC (permalink / raw)
  To: 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-16 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16  7:50 Locale Support For MUSL Kevin Cheung
2015-10-16 14:32 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).