Making Friends With Emacs and UTF-8

After having a few issues with UTF-8 support in Emacs earlier (I .. well .. err .. use emacs as my .. mail editor.), I finally found a solution that works with both putty and gterm as my terminals.

The important settings I ended up using in my .emacs:

(prefer-coding-system       'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)

(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))

Archived for my own use at a later time.

3 thoughts on “Making Friends With Emacs and UTF-8”

  1. Hi there,

    cheers for the post.

    I’ve tested it out in my urxvt SSH-ing into a remote Unix server and viewing my inbox in Emacs/VM.

    The summary page displays Chinese characters beautifully, but the message buffer (where the email is opened) still displays the \u888 codes. Mhmm. Editing international characters into the *scratch* buffer gives odd characters (but not the UTF8 escape entries as in VM).

    What kind of LC_/LANG settings do you have on your remote systems / let through from your local system?

    -Torstein

  2. LANG=”nb_NO.utf8″
    LC_ALL=”nb_NO.utf8″

    Works fine with both putty from Windows (using utf-8) and with gnome-terminal under Ubuntu (with encoding set to UTF-8 in the terminal).

Leave a Reply

Your email address will not be published. Required fields are marked *