meta data for this page
CHAR type variables
CHAR (character) types are suitable for storing a single letter each. The original CHAR uses codes from the ancient ASCII character mapping table. This table contains a mix of 255 different characters (letters, numbers, control characters, graphic symbols). Its advantage is that it requires only 1 byte, but its disadvantage is that the character set is quite limited; for example, Hungarian or Chinese accented characters are mostly excluded.
The extended version of CHAR is WCHAR (wide-character), which has a 2-byte length but can be used more broadly with its (UNICODE) UCS-2 mapping. Up to 65,535 character mappings can be encoded with 16 bits; UNICODE does not fully utilize this range.
| Type | Name | Bit | Code table | Value range HEX | Value range DEC | Example |
|---|---|---|---|---|---|---|
| CHAR | character | 8 | ASCII | 0 .. FF | 0 .. 255 | 'P', CHAR#'P' |
| WCHAR | Wide character | 16 | UCS-2 | $0000 - $D7FF | 0 .. 55.295 | WCHAR#'Ő' |