As the subject line says, it always returns US-ASCII when I expected UTF-8 on my FreeBSD 10.1 system.
Here is a sample program to test this function:
These are the environment variables setup on my system.
From the FreeBSD man page:
FreeBSD 4.6 was released back in 2002. So I'm puzzled as to why it doesn't seem to work on my system.
Here is a sample program to test this function:
Code:
/* Compile with "gcc48 -W -Wall -o langinfo langinfo_test.c" */
#include <stdio.h>
#include <langinfo.h>
int main()
{
printf("%s\n", nl_langinfo(CODESET));
return 0;
}
These are the environment variables setup on my system.
Code:
[tmp]$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_TIME=en_DK.UTF-8
LC_NUMERIC="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_ALL=
[tmp]$ export LC_TYPE=en_GB.UTF-8
[tmp]$ ./langinfo
US-ASCII
From the FreeBSD man page:
HISTORY
The nl_langinfo() function first appeared in FreeBSD 4.6.
FreeBSD 4.6 was released back in 2002. So I'm puzzled as to why it doesn't seem to work on my system.