Previous: , Up: Expressions   [Contents][Index]

6.6 Where You Are Makes A Difference

Modern systems support the notion of locales: a way to tell the system about the local character set and language.

Once upon a time, the locale setting used to affect regexp matching (see Ranges and Locales), but this is no longer true.

Locales can affect record splitting. For the normal case of ‘RS = "\n"’, the locale is largely irrelevant. For other single-character record separators, setting ‘LC_ALL=C’ in the environment will give you much better performance when reading records. Otherwise, gawk has to make several function calls, per input character, to find the record terminator.

According to POSIX, string comparison is also affected by locales (similar to regular expressions). The details are presented in POSIX String Comparison.

Finally, the locale affects the value of the decimal point character used when gawk parses input data. This is discussed in detail in Conversion.