Use UTF-16 in the ASC and CHR functions
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Syntax
To
use UTF-16 in the ASC function, use the following
syntax:
|
- ch
- One character, like
'A',"A", or'~U034e'. - source-cp
- The name of the source code page.
This returns one of the following values, which are platform independent:
- An integer less than 65536, representing the Unicode scalar value in plane 0
- A long integer composed of the high surrogate in the high-order 16 bits of the int and the low surrogate in the low-order 16 bits of the int
Syntax
To
use UTF-16 in the CHR function, use the following
syntax:
|
- n
- The numeric value of the character.
- target-cp
- The name of the target code page.
This command interprets its input as one of the following platform-independent values:
- The Unicode scalar value for plane 0
- An integer composed of a high surrogate in the high-order 16 bits and the low-surrogate in the low order 16 bits
When
using UTF-16 in CODEPAGE-CONVERT, the behavior
of character strings as UTF-16 are sensitive to byte order and the
presence of null bytes. ABL can handle UTF-16 strings as RAW or MEMPTR data,
and the use of PUT-UNSIGNED-SHORT and GET-UNSIGNED-SHORT solves
any byte order machine dependencies.