Next | Prev | Up | Top | Contents | Index

Overview of Locale-Specific Behavior

This section covers


Local Customs

To meet the requirements of local customs, the X/Open Native Language System (NLS) interface provides a set of library functions that allow cultural data appropriate to the user to be determined at run-time.


Regular Expressions

Regular expressions provide pattern-matching facilities for text. A variety of regular expression support libraries are supplied with IRIX. Most of them parse regular expressions in terms of machine collating sequences, the English language, and the ASCII coded character set.

When a program deals with internationalized input text, it is important to extend regular expression facilities to cover internationalized strings and coded character sets. It is difficult to write regular expressions that apply to more than one language, or to languages with accented/multi-character collating elements because of limitations in syntax.

Application programs can use the wsregexp function library, documented in the wsregexp(3W) reference page, to support internationalized regular expression behavior.


The ANSI X3.159-198X Standard for C

The American National Standards Committee X3J11 standard for the C programming language includes a number of library functions that are defined to operate internationally; that is, they modify their operation in a manner appropriate to the user's native language and cultural environment.

The X/Open definition includes the international functions in Table 6-4 as defined in Draft ANSI X3.159, Programming Language C. ANSI functions that are enhanced by the X/Open definition are marked with an asterisk.

ANSI Compatible Functions
Function 
atof() scanf() *
fprintf() * setlocale()
fscanf() * sprintf() *
isalnum() sscanf() *
isalpha() strcoll()
isgraph() sterror()
islower() strftime()
isprint() strtod()
ispunct() strxfrm()
isspace() tolower()
isupper() toupper()
printf() *  

Draft ANSI X3.159, Programming Language C also defines a number of multi-byte functions, and an additional function for manipulating monetary values. At this stage, the X/Open definition is only guaranteed to work correctly for single-byte 8-bit characters, and thus does not include the multi-byte functions.

In addition, X/Open defines internationalized regular expression compile and match functions, native language message-handling functions, and native language versions of the error-handling functions (see Table 6-5).

X/Open Additional Functions
Function 
catclose() regexp()
catgets() vfprintf()
catopen() vprintf()
nl_langinfo() vsprintf()
perror()  


Next | Prev | Up | Top | Contents | Index