User Tools

Site Tools


internationalization.htm

Coming in a future release

In prior Clarion versions, internationalization settings were set or modified by using the ENV file or by calls to the LOCALE function. Clarion 11 introduces new settings for internationalization: the codepage number and locale id number (recommended in place of the ENV file). These settings allow conformant processing of both ANSI and Unicode strings while the old implementation is useful for ANSI strings only.

As of version 11 the recommended method to implement support for Unicode and apply international settings is to use the new

PROP:Codepage and PROP:Locale properties.

The values for the code page and locale id can be set several different ways:

·by setting PROP:Codepage and PROP:Locale properties respectively for the SYSTEM property (this is the preferred method), for example:
 
SYSTEM {PROP:Codepage} = 1253        !Greek

SYSTEM {PROP:Locale} = 1032                !Greek

·by calling the LOCALE function with the first parameter equal to 'CLACODEPAGE' and 'CLALCID' respectively, for example:

LOCALE('CLACODEPAGE', 1253)

LOCALE('CLALCID', 1032)

·by specifying the CLACODEPAGE and CLALCID parameters in the program ENV file.

Note: The RTL does not check the values of the codepage number or the locale id for compatibility. It is recommended to set the locale id to provide the Clarion RTL with the names and abbreviations of months, days of week, AM/PM identifiers, and other internationalization settings. If the program does not set the code page and locale id the RTL uses the settings for the current Windows user.
Using any of the above methods to set the code page and locale id, the settings are applied before reading the ENV file (if it exists). This means  that the settings in the ENV file
override corresponding settings that are set from PROP:CODEPAGE and PROP:LOCALE (locale id). Settings for CLACASE, CLACOLSEQ and CLADIGRAPH parameters in the ENV file or specified by calling the LOCALE function do not affect processing of Unicode strings. Changing the code page setting at run time (by setting the PROP:CODEPAGE property or by calling the LOCALE function) resets all previous settings for CLACHARSET, CLASYSCHARSET, CLACASE, CLACOLSEQ and CLADIGRAPH parameters. Changing the locale id setting at run time resets all previous settings for CLACASE, CLACOLSEQ, CLADIGRAPH, CLAMONTH, CLAMON, CLADOWNAME, CLADOW, CLAAMPM and CLABUTTON parameters. . The RTL provides two functions to support working with ANSI and Unicode strings; TOUNICIDE() and TOANSI(). The TOUNICODE and TOANSI functions have 2 parameters: the first is a string expression to convert to Unicode or to ANSI, the second one is a code page number applied for the ANSI string parameter (TOUNICODE) or the result (TOANSI). This second parameters allows for conversions to and from ANSI strings encoded for languages other than the current system language.
 
The TOANSI function allows you to convert ANSI and Unicode strings to a character sequence encoded in UTF-8 by passing the value 65001 as the second parameter.
See Also:**

PROP:CODEPAGE

PROP:LOCALE

LOCALE

TOUNICODE

TOANSI

SYSTEM

Example of ENV settings

PROP:CharSet

internationalization.htm.txt · Last modified: 2021/04/15 15:46 by 127.0.0.1