How to make emacs accept UTF-8 from the keyboard

Posted by Brent.Longborough on Super User See other posts from Super User or by Brent.Longborough
Published on 2012-04-08T20:36:50Z Indexed on 2012/04/10 17:33 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

My friends have persuaded me to "try again" (about the 5th time in about 12 years) with emacs. I'm currently suffering a little, and need help with emacs + utf-8.

I'm running the 23.3.1 emacs gui on Windows 7 with my own custom keyboard layout (built with MS Keyboard Layout Creator). The layout has a full ISO-8859-1 (Latin-1) character set, plus some additional characters from ISO-8859-9 (Latin-5, gis etc for Turkish) and w for Welsh (don't know where that one lives).

In my .emacs, I have (blindly) added these lines:

;; key board / input method settings
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-language-environment 'UTF-8) ; prefer utf-8 for language settings

Now, when I enter characters from ISO Latin-1 from the keyboard, they are accepted without problems, but characters from outside Latin-1 are "translated" to an approximate character in Latin-1. Thus, for example, Latin-5 "g" gets converted to a plain "g".

Cutting and pasting, however, work fine.

Can anyone tell me what I'm doing wrong? I should like to make everything I do with emacs utf-8 with BOM.

© Super User or respective owner

Related posts about keyboard

Related posts about emacs