LANGINFO(3C)
NAME
langinfo, langtoid, idtolang, currlangid − information on user’s native language as given by NLS
SYNOPSIS
#include <langinfo.h>
char *langinfo(langid, item)
int langid, item;
int langtoid(langname)
char *langname;
char *idtolang(langid)
int langid;
int currlangid()
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: HP
Native Language Support:
8−bit data, customs, messages
DESCRIPTION
Langinfo retrieves a null-terminated string containing information unique to a language or cultural area. For example langinfo(currlangid(), DAY_1) returns a pointer to the string “Dom” if LANG (see environ(7)) is set to “portuguese”, and “sun” if LANG is set to “finnish”. The following items have been defined.
D_T_FMT string for formatting date(1)
DAY_1 Name of the first day of the week (“Sunday” in English)
. . . . . .
DAY_7 Name of the seventh day of the week
ABDAY_1 Abbreviated name of the first day of the week (“Sun” in English)
. . . . . .
ABDAY_7 Abbreviated name of the seventh day of the week
MON_1 Name of the first month in the Gregorian year
. . . . . .
MON_12 Name of the twelfth month
ABMON_1 Abbreviated name of the first month
. . . . . .
ABMON_12 Abbreviated name of the twelfth month
RADIXCHAR radix character (“decimal point” in English)
THOUSEP separator for thousands
YESSTR affirmative response for yes/no questions
NOSTR negative response for yes/no questions
CRNCYSTR symbol for currency preceded by ’-’ if it precedes the number, For example, "-f" would be used for Dutch, "+ Kr" for Danish.
Currlangid looks for a LANG string in the user’s environment. If it finds it, it returns the corresponding integer listed in langid(7). Otherwise it returns 0 to indicate a default to native-computer, the method used before Native Language Support (NLS) was available.
Idtolang takes the integer langid and attempts to return the corresponding character string defined in langid(7). If langid is not found, an empty string is returned.
Langtoid is the reverse of idtolang, trying to convert a string to a language ID, and returning 0 to indicate native-computer if a match cannot be found.
SEE ALSO
getenv(3C), environ(7), hpnls(7), langid(7).
BUGS
Langinfo returns a pointer to a static area which is overwritten on each call.
Hewlett-Packard — last mod. May 11, 2021