langinfo(3C)
NAME
langinfo(), langtoid(), idtolang(), currlangid() − NLS information about native languages
SYNOPSIS
#include <langinfo.h>
char *langinfo(int langid, nl_item item);
int langtoid(const char *langname);
char *idtolang(int langid);
int currlangid(void);
DESCRIPTION
Note: All functions defined on this page are obsolete. Use of nl_langinfo(3C) is recommended as a replacement for langinfo().
langinfo() returns a pointer to a null-terminated string containing information relevant to a particular language or cultural area defined in the program’s locale (see setlocale(3C)). langinfo() effectively calls langinit() (see nl_init(3C)) to load the program’s locale according to the language specified by langid. If langid or item (or both) is bad, langinfo() returns a pointer to a NULL string.
currlangid() looks for a LANG string in the user’s environment. If it finds one, currlangid() returns the corresponding integer listed in lang(5). Otherwise, it returns 0 to indicate a default to native-computer, the method used before NLS was available.
idtolang() takes the integer langid and attempts to return the corresponding character string defined in lang(5). If langid is not found, an empty string is returned.
langtoid() is the inverse of idtolang(): it attempts to convert a string to a language ID, returning 0 to indicate native-computer if no match is found.
EXTERNAL INFLUENCES
Locale
The string returned by langinfo() for a particular item is determined by the locale category specified for that item in langinfo(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
langinfo() returns a pointer to a static area that is overwritten on each call.
AUTHOR
langinfo() was developed by HP.
SEE ALSO
nl_init(3C), nl_langinfo(3C), setlocale(3C), hpnls(5), lang(5), langinfo(5).
Hewlett-Packard Company — HP-UX Release 9.0: August 1992