Progress
Internationalization Guide


4GL Support For Processing Multi-byte Characters

The Progress 4GL supports multi-byte characters in general and has many elements that support multi-byte characters in particular. Table 8–6 describes these language elements.

Table 8–6: 4GL Elements For Processing Multi-byte Applications
4GL Element
Brief Description
Multi-byte Support
ASC Function
Returns the integer that corresponds to a given character.
You can specify source and target code pages, which can be multi-byte.
For a double-byte character, ASC returns a value greater than 255 and less than 65536.
For a triple-byte character, ASC returns a value less than 15,712,191
(hex 0xEFBFBF).
For an invalid character, ASC returns -1.
CHR Function
Returns the character that corresponds to a given integer in the target code page.
You can specify source and target code pages. If you do, CHR converts the value from source to target before returning it to you.
Code pages can be multi-byte.
If the INTEGER value is greater than 255 and less than 15,712,191, CHR checks for a valid lead-byte value. If found, CHR returns a double-byte character.
If the INTEGER expression exceeds 15,712,191 or does not correspond to a valid lead-byte or trail-byte value, CHR returns a null string.
ENCODE Function
Encodes a character string.
The character string can contain multi-byte characters.
FORMAT Phrase
Specifies the display format of, among other things, character strings.
For a field that contains multi-byte characters, you can specify the width in columns.
INDEX Function
Returns the position of one character string within another.
The character strings can contain multi-byte characters.
IS–LEAD–BYTE Function
Returns TRUE if the first byte of a character string has a value that falls within the range permitted for lead bytes.
Expressly designed for multi-byte characters.
LENGTH Function
Returns the number of characters, bytes, or columns in a character string.
Characters can be multi-byte.
You can set the unit of measure to characters, bytes, or columns.
OVERLAY Statement
Overlays a character string on a variable or field at the given position and optionally for the given length.
Characters can be double byte or triple byte.
You can set the unit of measure to characters, bytes, or columns.
STRING Function
Converts a value of any data type to CHARACTER.
The value can contain double-byte or triple-byte data
SUBSTRING Function
Returns a specified portion of a character string.
Characters can be multi-byte.
You can set the unit of measure to characters, bytes, or columns.
SUBSTRING Statement
Overlays a specified portion of a character string with another character string.
Characters can be multi-byte.
You can set the unit of measure to characters, bytes, or columns.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095