Unicode
Windows Frotz 2002 fully implements the support for Unicode specified in Version 1.0 of the Z-Machine
Standards Document. Unicode is an attempt to get around the problem of different character sets being
required for different alphabets. Unicode defines around 20,000 different characters, covering the Latin,
Greek, Cyrillic and Arabic alphabets, plus all sorts of other symbols.
In order to add a Unicode character that can be both printed and read in as input, add the character to
the game's Zcharacter table. For example, the following Inform source
Zcharacter table + '@{20ac}';
adds the Euro currency symbol to the Zcharacter table. This allows the symbol to be used in print
statements, such as
print "The cost will be @{20ac}99.95^";
Version 1.0 of the Z-Machine Standards Document defines two new opcodes relating to Unicode:
check_unicode, which checks if a Unicode character is available for input or output, and
print_unicode, which prints a Unicode character, regardless of whether or not it is in the
Zcharacter table.
At the time of writing, these opcodes are not defined in the latest version of Inform, Inform 6.21.
Therefore, these opcodes must be referred to with the @"" syntax:
[ PrintUnicode c i;
! check_unicode
@"EXT:12S" c -> i;
! print_unicode
if (i & 1)
@"EXT:11" c;
];