If you're a fan of the classic game Nethack, you might have run into an issue where the game's ncurses characters are displayed as Chinese characters in PuTTY. This can be frustrating, but don't worry - there's a way to fix it!
First, let's understand why this is happening. PuTTY is a terminal emulator that allows you to connect to remote servers. It supports a variety of character sets, but sometimes there can be discrepancies between the character sets used by the server and the client. In the case of Nethack, the server is using the ncurses character set, while PuTTY is using a different character set that is displaying the ncurses characters as Chinese characters.
To fix this issue, you'll need to change the character set used by PuTTY. Here's how to do it:
- Open PuTTY and connect to the server running Nethack.
- Go to the "Window" category in the left-hand menu.
- Click on "Translation" in the submenu.
- Under "Remote character set", select "UTF-8" from the dropdown menu.
- Click "Apply" to save the changes, then click "OK" to close the window.
Once you've changed the character set to UTF-8, the ncurses characters should be displayed correctly. If they're still not displaying correctly, you may need to check the character set used by the server. You can do this by running the following command in the terminal:
locale
This will display the character set used by the server. If it's not UTF-8, you may need to change it to match the character set used by PuTTY. This will depend on the server's operating system and configuration, so you may need to consult the server's documentation or contact the server administrator for help.
In addition to changing the character set, you may also want to consider changing the font used by PuTTY. By default, PuTTY uses a fixed-width font, but some fonts may display the ncurses characters better than others. To change the font, follow these steps:
- Go to the "Window" category in the left-hand menu.
- Click on "Appearance" in the submenu.
- Under "Font", select the font you want to use from the dropdown menu.
- Click "Apply" to save the changes, then click "OK" to close the window.
If you're still having trouble displaying the ncurses characters correctly, you may want to try using a different terminal emulator. Some terminal emulators are better suited to displaying ncurses characters than others. Some popular options include screen, tmux, and xterm.
In conclusion, if you're experiencing issues with PuTTY displaying ncurses characters as Chinese characters, there are a few things you can try to fix the issue. By changing the character set used by PuTTY to UTF-8, checking the character set used by the server, changing the font used by PuTTY, and trying a different terminal emulator, you should be able to get the ncurses characters displaying correctly.
References
| Title | URL |
|---|---|
| PuTTY - FAQ | https://www.chiark.greenend.org.uk/~sgtatham/putty/latest/htmldoc/ch06s4.html |
| Nethack - FAQ | https://nethackwiki.com/wiki/FAQ |
| ncurses - FAQ | https://invisible-island.net/ncurses/ncurses.faq.html |
| UTF-8 - Wikipedia | https://en.wikipedia.org/wiki/UTF-8 |