Update: See bottom for an update

Old Chinese MUDs uses BG* charsets, e.g., GBK, GB2312. Both Terminal app and iTerm2 can be configured and used to play. To set up the terminal:

Hint: Create a dedicated profile for MUD playing, call it "CN MUD"

To properly display GBK characters

  1. Change terminal app character encoding to BGK (in "advanced")
  2. Check the box "Unicode East Asian Ambiguous characters are wide" (in "advanced"). With this, the ASCII arts in the game (e.g. maps) will have misalignment.
  3. After that, the font can be left unchanged, as the English, mono font

To input GBK characters in shell

1
2
3
4
5
# zsh autocompletion helps prompting the values
export LC_ALL=zh_CN.GBK

# or, make a function to fire up tintin++:
LC_ALL=zh_CN.GBK tt++

To input GBK characters in Tintin++

When tt++ is launched, type in:

1
#config CHARSET GBK

This config is only documented here. It also didn't mention GBK as a valid value, but it seems so.

Without this step, typing GBK characters would freeze tt++ application and you'll have to kill it from another tty.

Update: Tue Sep 22 23:42:37 PDT 2020

I found tmux doesn't work with above solution. Because tmux doesn't support non-UTF8 locales:

 LC_CTYPE  The character encoding locale(1).  It is used for two separate
           purposes.  For output to the terminal, UTF-8 is used if the -u
           option is given or if LC_CTYPE contains "UTF-8" or "UTF8".
           Otherwise, only ASCII characters are written and non-ASCII
           characters are replaced with underscores (`_')...
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Luckily I found another more elegant way to solve the problem without changing terminal locale - using luit

luit can convert a single non-UTF8 program's input and output between UTF8 and a specified locale. Since tmux doesn't non-UTF8, so it is NOT useful to attempt luit -encoding GBK tmux. However, within a tmux pane, it is useful to do:

1
2
3
luit -encoding GBK tt++
# within tt++ do:
#config CHARSET GBK

In another tmux pane for displaying logging:

1
luit -encoding tail -f chat.log

TMUX setup

No matter luit or not, the terminal app needs to display east asian wide characters wide. However, once it's enabled, tmux's pane splitter would look strange. The vertical splitter would be invisible most of the time.

To fix this, tmux 3.2 introduced a setting pane-boarder-lines that allows use only ASCII characters for the splitters.

I was able to build tmux 3.2rc from source tarball easily on MacOS:

1
2
./configure && make
sudo make install

Once that, start the tmux and set:

1
set pane-boarder-lines simple

Would solve the problem.

Thu Aug 18 23:29:08 PDT 2022

I found easiest way is:

  1. use native terminal without using tmux
    1. set terminal encoding to gbk
    2. enable "ambiguous characters are double-width"
  2. in tt++, use #config CHARSET GBK to type chinese characters
    1. tt++ also supports GBK to UTF conversion (#config charset GBK1TOUTF8). See tt++ faq