Syntax
#include <langinfo.h> char *nl_langinfo(nl_item item);Description
nl_langinfo retrieves from the current locale the string that describes the requested information specified by item.
The constant names and values for item are defined in <langinfo.h> which includes <ulsitem.h>, the header file that actually contains the constant names and values.
nl_langinfo returns a pointer to a null-terminated string containing information about the active language or cultural area. The active language or cultural area is determined by the most recent setlocale call. Subsequent calls to the function may modify the array that the return value points to. Your own code cannot modify the array.
If item is not valid, nl_langinfo returns a pointer to an empty string.
This example uses nl_langinfo to retrieve the current codeset name.
#include <langinfo.h> #include <stdio.h> int main(void) { printf("Current codeset is %s\n", nl_langinfo(CODESET)); return 0; /**************************************************************************** The output should be similar to : Current codeset is IBM-850 ****************************************************************************/ }Related Information