Does gnome-terminal support DOS code pages?
In my C program I've had to swap my unicode box-drawing characters into e开发者_开发技巧scaped characters for DOS code page 437 to get it to work in the Windows command prompt. Is it possible to change the code page of gnome-terminal to display these characters correctly when natively compiling the program for linux?
Thanks.
From https://nethackwiki.com/wiki/IBMgraphics
The current gnome-terminal does not have a setting for code page 437, but it does support other code pages that are equivalent for NetHack's purposes, such as 862 (Hebrew).
To set code page 862 on gnome-terminal:
- Select Terminal->Set Character Encoding->Add or Remove.
- In the pane on the left, select the line with description Hebrew and encoding IBM862.
- Click the right-pointing arrow between the two panes.
- Click Close.
The above steps only need to be done once for the lifetime of the Gnome installation. Once done, it is sufficient to:
- Select Terminal, Set Character Encoding, and then Hebrew (IBM862).
It should be noted that the current default gnome-terminal font in Ubuntu Jaunty fully supports DECgraphics as long as eight_bit_tty is set to false.
If you need these characters, you should use their correct Unicode codepoint values and output them as UTF-8. Or, if you prefer, you can output them as wide characters and let the standard library's locale system take care of converting them to UTF-8 or another "native" encoding the user has selected (which might even be CP437, although I've never seen a system setup that poorly...).
精彩评论