This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

nl_langinfo question


Hi,

below is a slightly expanded example code from a recent nl_langinfo(3)
manual page but it doesn't work as I expect, it does not return the
values as defined in the locale used. Is there perhaps an issue with the
example code, in glibc, or am I missing something?

localhost:~/test> cat test.c
#include <langinfo.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char *argv[])
{
    setlocale(LC_CTYPE, "");
    printf("%s\n", nl_langinfo(CODESET));
    printf("%s\n", nl_langinfo(DAY_1));
    printf("%s\n", nl_langinfo(RADIXCHAR));
    printf("%s\n", nl_langinfo(NOEXPR));
    exit(EXIT_SUCCESS);
}
localhost:~/test> gcc -Wall test.c
localhost:~/test> LC_ALL=fi_FI.UTF-8 ./a.out
UTF-8
Sunday
.
^[nN]
localhost:~/test>

Thanks,

-- 
Marko Myllynen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]