Char function
Syntax
Char(n)
Description
Use the Char function to convert a decimal numeric value n to the corresponding Unicode character.
Parameters
| Parameter | Description |
|---|---|
|
n |
The numeric value to be expressed as a decimal Unicode value. |
Returns
Returns a string representing the Unicode character corresponding to the number n.
Example
This example sets three strings:
&STRING1 = Char(80) | Char(83);
&STRING2 = Char(26085) | Char(26412);
&STRING3 = Char(55362) | Char(56697);
The following table shows the Unicode hexadecimal code points and the string equivalents for these calls to the Char function:
| Variable | Char (Decimal) | Unicode Code Points | String |
|---|---|---|---|
|
&STRING1 |
Char(80) | Char(83) |
U+0050, U+0053 |
PS |
|
&STRING2 |
Char(26085) | Char(26412) |
U+65E5, U+672C |
日本 |
|
&STRING3* |
Char(55362) | Char(56697) |
U+D842 U+DD79 |
A single Chinese character |
* The single character in &STRING3 signifies a non-BMP, UTF-32 character (U+20979), which is represented by the UTF-16 surrogate pair (U+D842 U+DD79). This single Chinese character has been omitted from this example.
For reference, Unicode character charts are available from The Unicode Consortium.
Related Topics