NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: uselocale() function
On Tue, Feb 14, 2017 at 11:23:45AM +0100, Marc Baudoin wrote:
> Hi,
>
> I'm responsible for building the NetBSD binaries for the TeX Live
> distribution. We're preparing the 2017 release and I have a
> problem with the new version of a component (dvisvgm). It uses a
> uselocale() function which doesn't seem to exist in
> NetBSD-release. It's supposed to be part of POSIX :
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/uselocale.html
We do not implement that. It is rarely usefull and only obfuscates code
by separating the locale setting from the actual output that requires it.
The C++ model is much more usefull...
> How to handle this? Is there a replacement that could act as this
> uselocale() function or emulate it?
Use printf_l(3) and friends. Most typical use in software is to force the
C locale, which is even simpler by using LC_C_LOCALE, like:
printf_l(LC_C_LOCALE, "this is a float value: %.2f\n", 2.5f);
Martin
Home |
Main Index |
Thread Index |
Old Index