Define the environment variables

This section describes all environment variables that a user must define to operate GT.M with Unicode support.

gtm_chset

The environment variable gtm_chset determines the mode in which GT.M operates. If it has a value of "UTF-8" (at process startup), then GT.M interprets strings encoded in UTF-8 character set.

If it has a value of "M", then GT.M interprets string as being composed of 256 combinations of the 8 bits in a byte as a character, that is, the ASCII character set.

[Note]

See "GT.M Operations – M mode and UTF-8 mode" for more information on operating GT.M for ASCII and non-ASCII character sets.

gtm_dist

The gtm_dist environment variable specifies the path to the directory containing the GT.M system distribution for Unicode. The distribution for Unicode is located in subdirectory utf8 under the GT.M distribution directory.

For example, if the GT.M distribution is in /usr/local/gtm, enter:

$ gtm_dist=/usr/local/gtm/utf8 ; 
>$ export gtm_dist

Add $gtm_dist to the system environment variable PATH as follows:

$ PATH=$PATH:$gtm_dist
$ export PATH

gtm_dist is used to establish communications with the GT.M gtmsecshr daemon and for the location of GT.M components.

[Important]

GT.M generates the distribution for Unicode only if ICU 3.6 is installed on the system. Therefore, installing ICU is a prerequisite for GT.M to perform functionality related to Unicode.

gtmroutines

The gtmroutines environment variable specifies a directory search list of possible locations for M routines and UTF-8 routines. This search enables GT.M to find the routine (program) that a user may want to run even if it is not in the current working directory.

The following is an example of a gtmroutines definition, assuming that $ gtm_dist has been defined and is set to /usr/local/gtm/utf8:

$ gtmroutines=". $gtm_dist `echo $gtm_dist | sed 's/utf8\(\/\)*//'`"
$ export gtmroutines
echo $gtmroutines 
usr/local/gtm/utf8 /usr/local/gtm/ 

This specifies that GT.M first search for a routine in the current directory, then in the Unicode distribution directory (included in the list because it contains the UTF-8 compatible object modules for the utility routines) and then in the GT.M main distribution directory. Users can include other directory as well with space as the delimiter. See the "$ZROUTINES" section of the "Intrinsic Special Variables" chapter in the GT.M Programmer's Guide for details on gtmroutines.

LC_CTYPE

Use the environment variable LC_CTYPE is set to a locale with UTF-8 support. For example, "zh_CN.utf8".

LD_LIBRARY_PATH

Use the environment variable LD_LIBRARY_PATH (or LIBPATH in AIX) to point to the location of ICU. GT.M requires ICU 3.6 to perform Unicode related functionality. Note that the ICU installation instructions may differ by platform.