mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] setlocale() behaviour
@ 2023-07-19  8:30 Alastair Houghton
  2023-07-19 16:51 ` Markus Wichmann
  0 siblings, 1 reply; 4+ messages in thread
From: Alastair Houghton @ 2023-07-19  8:30 UTC (permalink / raw)
  To: musl

Hi there,

Presently, musl’s setlocale() function essentially always succeeds, even if it doesn’t actually have data for the requested locale. I note the previous message to the list in 2017

<https://www.openwall.com/lists/musl/2017/11/08/1>

discussing potential solutions, but unless I’m much mistaken nothing has really changed in the code?

This has come up because the test rig for libc++ tries to detect which locale data is installed so that it can run its own locale support tests (it’s trying to test the C++ locale support that it has constructed atop the C library’s underlying locale support).  If, for instance, you don’t have data for fr_FR installed, libc++ won’t run test cases that rely on that data.  On other C library implementations, that’s easy because setlocale() will return NULL in such a case, but musl doesn’t do that - instead, it sets up a copy of C.UTF-8, names it fr_FR and sets that as the current locale :-(

Kind regards,

Alastair.


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

end of thread, other threads:[~2023-07-21 10:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  8:30 [musl] setlocale() behaviour Alastair Houghton
2023-07-19 16:51 ` Markus Wichmann
2023-07-19 17:10   ` Alastair Houghton
2023-07-21 10:48     ` Alastair Houghton

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).