2019-07-15 12:21:50 +00:00
|
|
|
|
[< back to index](../doc_index.md)
|
2018-07-27 22:58:20 +00:00
|
|
|
|
|
|
|
|
|
# Text encodings ans escape sequences
|
|
|
|
|
|
|
|
|
|
### Text encoding list
|
|
|
|
|
|
|
|
|
|
* `default` – default console encoding (can be omitted)
|
|
|
|
|
|
|
|
|
|
* `scr` – default screencodes
|
|
|
|
|
(usually the same as `default`, a notable exception are the Commodore computers)
|
|
|
|
|
|
|
|
|
|
* `ascii` – standard ASCII
|
|
|
|
|
|
2018-12-30 17:54:45 +00:00
|
|
|
|
* `pet` or `petscii` – PETSCII (ASCII-like character set used by Commodore machines from VIC-20 onward)
|
|
|
|
|
|
2019-07-30 13:10:29 +00:00
|
|
|
|
* `petjp` or `petsciijp` – PETSCII as used on Japanese versions of Commodore 64
|
|
|
|
|
|
2018-12-30 17:54:45 +00:00
|
|
|
|
* `origpet` or `origpetscii` – old PETSCII (Commodore PET with original ROMs)
|
|
|
|
|
|
|
|
|
|
* `oldpet` or `oldpetscii` – old PETSCII (Commodore PET with newer ROMs)
|
2018-07-27 22:58:20 +00:00
|
|
|
|
|
|
|
|
|
* `cbmscr` or `petscr` – Commodore screencodes
|
|
|
|
|
|
2019-07-30 13:10:29 +00:00
|
|
|
|
* `cbmscrjp` or `petscrjp` – Commodore screencodes as used on Japanese versions of Commodore 64
|
|
|
|
|
|
|
|
|
|
* `apple2` – Apple II charset ($A0–$DF)
|
2018-07-27 22:58:20 +00:00
|
|
|
|
|
|
|
|
|
* `bbc` – BBC Micro character set
|
|
|
|
|
|
|
|
|
|
* `sinclair` – ZX Spectrum character set
|
|
|
|
|
|
|
|
|
|
* `jis` or `jisx` – JIS X 0201
|
|
|
|
|
|
|
|
|
|
* `iso_de`, `iso_no`, `iso_se`, `iso_yu` – various variants of ISO/IEC-646
|
|
|
|
|
|
|
|
|
|
* `iso_dk`, `iso_fi` – aliases for `iso_no` and `iso_se` respectively
|
2019-07-12 11:29:59 +00:00
|
|
|
|
|
|
|
|
|
* `atascii` or `atari` – ATASCII as seen on Atari 8-bit computers
|
|
|
|
|
|
|
|
|
|
* `atasciiscr` or `atariscr` – screencodes used by Atari 8-bit computers
|
2018-07-27 22:58:20 +00:00
|
|
|
|
|
|
|
|
|
When programming for Commodore,
|
|
|
|
|
use `pet` for strings you're printing using standard I/O routines
|
|
|
|
|
and `petscr` for strings you're copying to screen memory directly.
|
|
|
|
|
|
|
|
|
|
### Escape sequences
|
|
|
|
|
|
|
|
|
|
##### Available everywhere
|
|
|
|
|
|
|
|
|
|
* `{q}` – double quote symbol
|
|
|
|
|
|
|
|
|
|
* `{apos}` – apostrophe/single quote
|
|
|
|
|
|
|
|
|
|
* `{x00}`–`{xff}` – a character of the given hexadecimal value
|
|
|
|
|
|
|
|
|
|
##### Available only in some encodings
|
|
|
|
|
|
2018-12-17 16:03:52 +00:00
|
|
|
|
* `{n}` – new line
|
|
|
|
|
|
2018-07-27 22:58:20 +00:00
|
|
|
|
* `{b}` – backspace
|
|
|
|
|
|
|
|
|
|
* `{lbrace}`, `{rbrace}` – opening and closing curly brace (only in encodings that support braces)
|
|
|
|
|
|
|
|
|
|
* `{up}`, `{down}`, `{left}`, `{right}` – control codes for moving the cursor
|
|
|
|
|
|
|
|
|
|
* `{white}`, `{black}`, `{red}`, `{green}`, `{blue}`, `{cyan}`, `{yellow}`, `{purple}` –
|
|
|
|
|
control codes for changing the text color
|
|
|
|
|
|
|
|
|
|
* `{bgwhite}`, `{bgblack}`, `{bgred}`, `{bggreen}`, `{bgblue}`, `{bgcyan}`, `{bgyellow}`, `{bgpurple}` –
|
|
|
|
|
control codes for changing the text background color
|
|
|
|
|
|
|
|
|
|
* `{reverse}`, `{reverseoff}` – inverted mode on/off
|
|
|
|
|
|
2019-07-30 13:10:29 +00:00
|
|
|
|
##### Character availability
|
|
|
|
|
|
|
|
|
|
Encoding | lowercase letters | backslash | pound | yen and katakana | card suits
|
|
|
|
|
--|--|--|--|--|--|--
|
|
|
|
|
`pet`, `origpet` | yes¹ | no | no | no | yes¹
|
|
|
|
|
`oldpet` | yes² | no | no | no | yes²
|
|
|
|
|
`petscr` | yes¹ | no | yes | no | yes¹
|
|
|
|
|
`petjp` | no | no | no | yes³ | yes³
|
|
|
|
|
`petscrjp` | no | no | no | yes³ | yes³
|
|
|
|
|
`sinclair`, `bbc` | yes | yes | yes | no | no
|
|
|
|
|
`apple2` | no | yes | no | no | no
|
|
|
|
|
`atascii` | yes | yes | no | no | yes
|
|
|
|
|
`atasciiscr` | yes | yes | no | no | yes
|
|
|
|
|
`jis` | yes | no | no | yes | no
|
|
|
|
|
all the rest | yes | yes | no | no | no
|
|
|
|
|
|
|
|
|
|
1. `pet`, `origpet` and petscr` cannot display card suit symbols and lowercase letters at the same time.
|
|
|
|
|
Card suit symbols are only available in graphics mode,
|
|
|
|
|
in which lowercase letters are displayed as uppercase and uppercase letters are displayed as symbols.
|
|
|
|
|
|
|
|
|
|
2. `oldpet` cannot display card suit symbols and lowercase letters at the same time.
|
|
|
|
|
Card suit symbols are only available in graphics mode, in which lowercase letters are displayed as symbols.
|
|
|
|
|
|
|
|
|
|
3. `petjp` and `petscrjp` cannot display card suit symbols and katakana at the same time
|
|
|
|
|
Card suit symbols are only available in graphics mode, in which katakana is displayed as symbols.
|
|
|
|
|
|
|
|
|
|
If the encoding does not support lowercase letters (e.g. `apple2`, `petjp`, `petscrjp`),
|
|
|
|
|
then text and character literals containing lowercase letters are automatically converted to uppercase.
|
|
|
|
|
|
2018-07-27 22:58:20 +00:00
|
|
|
|
##### Escape sequence availability
|
|
|
|
|
|
2019-07-30 13:10:29 +00:00
|
|
|
|
Encoding | new line | braces | backspace | cursor movement | text colour | reverse | background colour
|
2019-07-12 11:29:59 +00:00
|
|
|
|
--|--|--|--|--|--|--
|
2019-07-30 13:10:29 +00:00
|
|
|
|
`pet`,`petjp` | yes | no | no | yes | yes | yes | no
|
|
|
|
|
`origpet` | yes | no | no | yes | no | yes | no
|
|
|
|
|
`oldpet` | yes | no | no | yes | no | yes | no
|
|
|
|
|
`petscr`, `petscrjp`| no | no | no | no | no | no | no
|
|
|
|
|
`sinclair` | yes | yes | no | yes | yes | yes | yes
|
|
|
|
|
`ascii`, `iso_*` | yes | yes | yes | no | no | no | no
|
|
|
|
|
`apple2` | no | yes | no | no | no | no | no
|
|
|
|
|
`atascii` | yes | no | yes | yes | no | no | no
|
|
|
|
|
`atasciiscr` | no | no | no | no | no | no | no
|
|
|
|
|
all the rest | yes | yes | no | no | no | no | no
|