2.2 KiB
Text encodings ans escape sequences
Text encoding list
-
default
– default console encoding (can be omitted) -
scr
– default screencodes (usually the same asdefault
, a notable exception are the Commodore computers) -
ascii
– standard ASCII -
pet
orpetscii
– PETSCII (ASCII-like character set used by Commodore machines) -
cbmscr
orpetscr
– Commodore screencodes -
apple2
– Apple II charset ($A0–$CF) -
bbc
– BBC Micro character set -
sinclair
– ZX Spectrum character set -
jis
orjisx
– JIS X 0201 -
iso_de
,iso_no
,iso_se
,iso_yu
– various variants of ISO/IEC-646 -
iso_dk
,iso_fi
– aliases foriso_no
andiso_se
respectively
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
-
{n}
– new line -
{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
Escape sequence availability
Encoding | new line | braces | backspace | cursor movement | text colour and reverse | background colour |
---|---|---|---|---|---|---|
pet |
yes | no | no | yes | yes | no |
petscr |
no | no | no | no | no | no |
sinclair |
yes | yes | no | yes | yes | yes |
ascii , iso_* |
yes | yes | yes | no | no | no |
apple2 |
no | yes | no | no | no | no |
all the rest | yes | yes | no | no | no | no |