locale

A locale defines a set of rules for a language and culture. If the platform on which TF runs supports locales, TF will support the following categories of locale rules:

LC_CTYPE
determines what characters are allowed, and whether they should be treated as letters, digits, puctuation, or control characters. When using a locale with an 8-bit character set, make sure that TF's istrip variable is off.
LC_TIME
determines the names and formats used in displaying dates and times with /time, ftime(), etc.

The user can set the locale either by having special variables defined in the environment before starting TF (preferred), or by setting them while TF is running (they will automatically be exported to the environment even if /set is used). The exact rules for setting locale depend on the platform, and should be found your system's documentation for setlocale(). The rules are usually something like this:

  1. If the variable LC_ALL is set, its value is used as the locale for all supported categories.
  2. Otherwise, if the variable with the name of a category is set, its value is used as the locale for that category.
  3. Otherwise, if the variable LANG is set, its value is used as the locale for any supported categories that were not covered by the first two rules.
  4. If none of those are set for a category, the default "C" locale is used for that category, which allows the 7-bit ASCII character set and US English date and time formats.

The valid values for the locale variables depend on your system. On a POSIX system, the valid values can be listed with the shell command "locale -a".

Bugs:

If your system has locale support, but does not have any locales installed, you can get the POSIX 1003.2 WG15-collection locale definitions from ftp://dkuug.dk/i18n/ or ftp://i44ftp.info.uni-karlsruhe.de/pub/linux/ctype/.

Note to linux users and other users of GNU libc: at least some versions of GNU localedef generate invalid LC_TIME information from the WG15-collection sources, and the GNU libc causes any program that tries to use the invalid LC_TIME information to crash. Workarounds: delete the LC_TIME data; or, do not set any of the LC_ALL, LC_TIME, or LANG variables.


Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys