I've read that GNU Emacs handles international scripts via a system called Mule (Multi-Lingual-Environment).

I also read (somewhere, a while back) that there was a move afoot (in recent years) to make it Unicode compliant, and that this was being implemented in version 23 (-ish?).

I typed some Unicode text (eg.कैसे) into gedit, and successfully copied it into Emacs. The copy-paste works in both directions.

However, in Emacs, using Ctrl+Shift+U to type a single Unicode-Codepoint does not work, nor is the IBus Input Method Editor recognized by Emacs.

What is the state of play with Emacs and Unicode?
... and is it possible to use the IBus IME with Emacs?


Short answer: IBus with ibus.el; Gnome Ctrl+Shift+U ⇒ Emacs C-x 8 RET

Emacs's support for more-than-8-bit character sets comes from MULE, which is about as old as Unicode (it derives from support for Japanese), and much older than widespread support for Unicode (in terms of programs supporting Unicode text, fonts, etc.). Good Unicode support came with GNU Emacs 23, which is the default version as of Ubuntu 10.04. Acceptable Unicode support came with GNU Emacs 22, which was the default version as of Ubuntu 8.04. Prior versions did have some support for Unicode, but it was more common to run into bugs or limitations.

Emacs doesn't use Gnome, so you can't use Gnome input methods in it. For example, Ctrl+Shift+U to insert a code point by its hexadecimal code is a Gnome feature, so it doesn't work in Emacs. The native Emacs equivalent is Ctrl+Q, which for historical reasons must be followed by the octal code; if you prefer hexadecimal, customize read-quoted-char-radix to the value 16. A similar Emacs command is C-x 8 RET (ucs-insert; if you use it often, you may want to bind it to a shorter key sequence), which can be followed by a hexadecimal code point or the name of a unicode character, with completion.

Emacs has its own set of input methods, and can also use system input methods such as UIM (install uim-el. IBus support is relatively new; you need ibus.el, which isn't in Lucid and I think not in Maverick either; see also IBus on the Emacs wiki.

  • Thanks Gilles... Well explained... Re octal: It's great for permissions, but for anything over 7 I'd better stick with hex :) – Peter.O Nov 15 '10 at 17:51

GNU Emacs 23.x has built-in Unicode support for UTF-8-encoded text. Its also provides support for UTF-16. I really recommend you install the emacs23 package to avoid several bugs on Emacs related with Mule problems.

And to try to avoid Intelligent Input Bus problem, you can install Anthy input systems. I've seen it works very well for Japanese:

sudo apt-get install anthy anthy-el

After installing it, edit your .emacsrc to include the text below:

; Set load path for anthy.el
(push "/usr/share/emacs/site-lisp/anthy/" load-path)

; Load anthy.el
(load-library "leim-list")
(load-library "anthy")

;; Workarounds and customizations

; Fix slow input response in emacs23
(if (>= emacs-major-version 23)
(setq anthy-accept-timeout 1))

; Set japanese-anthy as the default input-method
(setq default-input-method "japanese-anthy")

; Shift-space to toggle anthy-mode (default is Ctrl-\)
(global-set-key (kbd "S-SPC") 'anthy-mode)

; Map wide-space to hankaku-space
(setq anthy-wide-space " ")

If this doesn't work for you, you may have found a bug on Emacs regarding its support for iBus.

  • Emacs is completely new to me, so bear with me if I'm way off track here (btw, I am using 23.1.1). I get the impression from what you said, that IBus "should" have worked. Maybe the key-combo Alt+Release+Alt_L (to start IBus) was commandeered by Emacs, but IBus simply didn't start; but it does elsewhere.... That Anthy works may(?) only be because it is a dedicated Emacs IME (which it is according to its apt desctiption). I'd be happy to use a dedicated IME, but I doubt that Anthy would suit because I need a Devanagari IME.... but whether or not IBus should work, still has me puzzled. – Peter.O Nov 13 '10 at 18:21
  • Your Ask is candidate to be submitted to emacs-bidi discussion list. Visit this site lists.gnu.org/mailman/listinfo/emacs-bidi and browser their Archives, if your answer is not there, then send a email asking your question their. Good Luck! – crncosta Nov 13 '10 at 18:38
  • Thanks... I just found this other bit of info ibus.el is IBus client for GNU Emacs" .. I have no idea if this is the way to go or not (zero Emacs experience), but it looks promising.... Maybe someone can comment on its useability (and effectiveness)... – Peter.O Nov 13 '10 at 18:59
  • @fred.bear: go ahead and give it a try! In general every info into the emacswiki.org is reliable. Just keep your attention to the commands and config files to edit. When you have done, please go back to here and accept this discussion, and the community will get the benefit of read our discussion. Thanks! – crncosta Nov 13 '10 at 19:12
  • I have installed the IBus Client for Emacs, and it reported no errors, but I haven't yet managed to get the IBus Language Panel to appear... but that could be because I don't knwo my way around Emacs well enough to do normal navigation, let alone tracking this down... I've posted a specific questoin about this here – Peter.O Nov 14 '10 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.