Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ langinfo(3C) — HP-UX 5.50

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

nl_init(3C)

environ(5)

hpnls(5)

langid(5)

LANGINFO(3C)  —  HP-UX

NAME

nl_langinfo, langinfo, langtoid, idtolang, currlangid − NLS information about native languages

SYNOPSIS

#include <nl_types.h>
#include <langinfo.h>

char ∗nl_langinfo(item)
nl_item item;

char ∗langinfo(langid, item)
int langid;
nl_item item;

int langtoid(langname)
char ∗langname;

char ∗idtolang(langid)
int langid;

int currlangid()

DESCRIPTION

Nl_langinfo and langinfo retrieve a null-terminated string containing information unique to a language or cultural area identified by the last successful call to nl_init(3C). If nl_init(3C) has not been called successfully, or for langinfo, if langid is not defined or the NLS (Native Language Support) environment corresponding to that langid is not available, the default NLS environment, ­“n-computer”, is used (see langid(5)).

For example, nl_langinfo( DAY_1 ) returns a pointer to the string “Dom” if the NLS environment is set to “portuguese”, and “sun” if the NLS environment is set to “finnish”. 

The following items are defined in <langinfo.h>:

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, “+” if it follows the number, and “.” if it replaces the radix.  For example, ­“-DM” would be used for German, “+ Kr” for Danish, and ­“.$” for Portuguese. 

BYTES_CHAR Maximum number of bytes per character for the character set used for the specified language.  For example, “1” for English and most European languages, and “2” for Japanese and several other Asian languages. 

If an invalid item is specified, a pointer to an empty string is returned.  An empty string can also be returned for a valid item, if that item is not applicable to the language or customs of the currently loaded NLS environment.  For example, a thousands separator is not used when writing numbers according to the customs associated with the Arabic language. 

Currlangid looks for a LANG string in the user’s environment.  If it finds one, currlangid returns the corresponding integer listed in langid(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 langid(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. 

WARNINGS

Nl_langinfo and langinfo return a pointer to a static area that is overwritten on each call. 

Langinfo is provided for historical reasons only.  Use of nl_langinfo is recommended. 

Langinfo effectively calls langinit (see nl_init(3C)) to load the NLS environment according to the language specified by langid.

HARDWARE DEPENDENCIES

Series 200, 300, 500
Nl_langinfo is currently not supported.  Use langinfo instead. 

BYTES_CHAR is not supported. 

AUTHOR

Langinfo was developed by HP. 

SEE ALSO

nl_init(3C), environ(5), hpnls(5), langid(5). 

INTERNATIONAL SUPPORT

8-bit data, messages. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026