Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Jun 2016 17:40:54 +0200
From: Remko Tronçon <remko@...tramo.be>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: How to set UTF-8 as default

Hi Rich,

Thanks for your explanation.

Just call setlocale(LC_CTYPE, ""). This is the only way a correct
> program should ever use setlocale.


So, if I understand correctly, any program that expects `nl_langinfo`
to return the locale set through environment variables (or other
platform-specific ways) should call setlocale(LC_*, "") before
querying the locale; libc/musl/... will not trigger this registration
itself.

NULL is not the same thing as "". Passing NULL as the second argument
> to setlocale simply queries the current locale name. It does not setup
> the locale.
>

Right, I was just pointing out that the locale I tried to set in env
variables wasn't
being reported as the current locale by setlocale().

thanks!
Remko

Content of type "text/html" skipped

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.