Furthermore, I have not tested this patch on a real Linux console --
only in an xterm. Linux consoles have supported UTF-8 since 1.2.1, so
it should work, provided a code-page 437 font is loaded (this is the
default, at least for US-based PCs).
The changes to the code are as follows:
* include/config.h -- Provide a new symbol, UNICODE, which enables the
UTF-8 mode. Probably should be turned off for MSDOS and friends.
* src/drawing.c -- When UNICODE is present, IBM_r_oc_syms receives all
of the Epyx Rogue symbols. The DevTeam's comment on the ring symbol
describes 0x09 as "circle with arrow", but in fact it is a simple
circle. The circle is hard to distinguish from an orc, so this byte
is changed to 0x0B, which is the real circle with arrow.
* src/mapglyph.c -- This is the one file that contains #ifdef ASCIIGRAPH
but does not include tcap.h, which may define that symbol in some
circumstances. Until now, it didn't matter; but with this patch,
the Rogue level still displays in black and white, even with
IBMgraphics, unless tcap.h is included.
* sys/share/ioctl.c, sys/unix/unixmain.c, sys/unix/unixunix.c -- Linux
and SCO define a set of functions to enable IBMgraphics on their
respective consoles while Nethack is in progress. UNICODE replaces
the calls to these functions with calls to a similar set that tells
the terminal to go to UTF-8 mode.
* sys/share/unixtty.c -- Defines the mode-switching functions described
* win/tty/wintty.c -- Here is where the IBM glyphs are mapped to Unicode.
UNICODE enables a new function, put_utf8, which accepts a character
in the IBM set, looks up a Unicode glyph, converts the glyph to UTF-8,
and prints it.
put_utf8 replaces putchar in g_putch when IBMgraphics is active, so
that the map displays the IBMgraphics, and in tty_putsym, to get the
currency symbol on the bottom line in the Rogue level.
--------------===============<[ Ray Chason ]>===============--------------
PGP public key at http://www.smart.net/~rchason/pubkey.asc
Delenda est Windoze