environ(5int) environ(5int)
Name
environ - natural language support (NLS) environment variables
Description
The international environment variables are defined for the ULTRIX system and are additional to those described in the ULTRIX reference
pages, Sections 2 (system calls) and 3 (routines), and the reference page. The international variables are made available to a process by
This reference page is divided into two sections. The first section describes environment variables that can control the locale setting.
The second section describes the variables that control where the function searches for message catalogs and where the function searches
for language databases.
Environment Variables That Control the Locale Setting
The LANG, LC_COLLATE, LC_TYPE, LC_NUMERIC, LC_TIME, and LC_MONETARY environment variables can control the locale setting. You define these
variables using the same format as the locale argument to the function. The following shows the format you use:
language[_territory[.codeset]][@modifier]
In language, you specify the native language of the user. You can optionally specify the user's dialect and codeset using _territory and
codeset. For example, the following definition of LANG specifies the French native language, as spoken in France (as opposed to in
Switzerland), and the Digital Multinational Character Set:
LANG = FRE_FR.MCS
In @modifier, you specify a specific instance of localization data within a single category. For example, using @modifier, you can specify
telephone directory ordering of data, as opposed to dictionary ordering of data. You cannot use @modifier to define the LANG variable.
The following list describes the environment variables that control the locale setting:
LANG Identifies the user's requirements for native language, local customs, and coded character set. At run time, you can bind
the user's language requirements, as specified by the setting of to the execution of a program by calling as follows:
setlocale (LC_ALL, "");
If is not defined in the current environment, the locale defaults to the C locale. For more information on the C locale,
see the POSIX Conformance Document.
System administrators can define to provide a default setting for the system as a whole, or user's can define individually
using standard command interpreter facilities.
LC_COLLATE Contains the user's requirements for language, territory, and codeset for the character collation format. affects the
behavior of regular expressions and the string collation functions in and If is not defined in the current environment, pro-
vides the necessary default.
LC_CTYPE Contains the user's requirements for language, territory, and codeset for the character classification and conversion for-
mat. affects the behavior of the character-handling functions in and If is not defined in the current environment, provides
the necessary default.
LC_MONETARY Contains the user's requirements for language, territory, and codeset for the monetary format. affects the currency string
in If is not defined in the current environment, provides the necessary default.
LC_NUMERIC Contains the user's requirements for language, territory, and codeset for the numeric data presentation format. affects the
radix and thousands separator character for the formatted I/O functions in and the string conversion functions in and If is
not defined in the current environment, provides the necessary default.
LC_TIME Contains the user's requirements for language, territory, and codeset for the time format. affects the behavior of the time
functions in If is not defined in the current environment, provides the necessary default.
Environment Variables That Specify Locations
The NLSPATH and INTLINFO environment variables control where the and functions search for message catalogs and the language databases. You
define these variables using a pathname or set of pathnames. The pathnames can contain variable elements, called substitution fields, that
allow your program or the setting of other environment variables to affect the setting of NLSPATH and INTLINFO. The following shows the
format you use to define these variables:
variable-name="[:][/directory][/substitution field]
[/file-name][:alternate-pathname][:..."
You specify either NLSPATH or INTLINFO in place of variable-name.
A colon (:) that precedes other parts of any pathname in the definition specifies the current directory.
In directory, you can specify a specific directory in which the function searches. If you need the environment variable to be flexible,
you can use a substitution field in place of or with directory names. A substitution field consists of a percent sign (%), followed by a
code letter. The substitution fields you can use are as follows:
%N The value of the name argument you pass to
%L The value of the LANG environment variable
%l The language element from LANG
%t The territory element from LANG
%c The codeset element from LANG
%% A literal percent sign
If a substitution field you specify is currently undefined, or substitutes a null string. Neither function includes the underscore (_) or
period (.) separator in or substitutions.
You can specify more than one pathname when you define these environment variables. You separate each pathname from the one that follows
it using a colon (:). If you need to specify the current directory in a pathname other than the first pathname in the list, use a double
colon (::). The functions interpret the first colon as a separator between pathnames and the second colon as specifying the current direc-
tory.
The following describes the ICONV, INTLINFO, and NLSPATH environment variables:
ICONV The ICONV environment variable stores the directory pathname for the conversion codesets used by the command. If this variable is
undefined, searches the directory.
The following example shows how to define ICONV:
ICONV=/usr/lib/international/conversions
In this example, is defined as the directory pathname
INTLINFO The INTLINFO environment variable stores the location of the language database. The function reads INTLINFO when it searches for
the database.
The following example shows how to define INTLINFO:
INTLINFO = ":%L:/usr/lib/intln/%L:/usr/lib/intln/ENG_%t.%c"
In this example, the function searches for the language database named in the LANG environment variable. The function searches
for the variable in the current directory. If the database is not in the current directory, searches in the directory for that
same database. Finally, if the database specified by LANG is unavailable, searches in for the English language database that
matches the current territory and codeset.
NLSPATH The NLSPATH environment variable controls where the function searches for a message catalog.
The following example shows defines NLSPATH:
NLSPATH=":%N.cat:/nlslib/%N.cat:nlslib/program.cat"
This definition causes to search in the current directory for the message catalog named in the name argument you pass. If the
function cannot find the message catalog in the current directory, it searches in the directory. If the catalog is not in that
directory, opens the message catalog.
See Also
exec(2), catopen(3int), intro(3int), setlocale(3), lang(5int)
Guide to Developing International Software
environ(5int)