How to set various locales with setlocale()?

Lee D embaudarm at gmail.com
Fri Feb 16 11:09:39 UTC 2018


Hi,

I have a C program that needs to print the date in the correct form
for the appropriate locale.

Unfortunately, setlocale() will not accept  any of the locale names in
/usr/share/locale/, (which is documented in the man page for
setlocale()).

This is an embedded program running on custom arm hardware, not a
normal user system, so I am trying to do everything from within the C
program.  Setting an environment variable and rebooting would be
cumbersome.

Do you folks have any suggestions on how to accomplish this goal, or
how to make setlocale accept the locales listed on the system?

Thanks.


More information about the freebsd-hackers mailing list