Monday, February 12, 2007

unicad.el

Emacs文件编码识别,解决乱码问题

unicad project is now hosted on Google Code: http://code.google.com/p/unicad/

The latest unicad.el can be find in the download list.

I would like to introduce unicad.el, a Universal charset auto detector for GNU Emacs.

If you have to deal text files in multi language (Chinese, Japanese, Russian, German or Polish) or have the experience of reading a garbled text file or being confused to choose a correct encoding, this unicad.el is here for you. It can tell (or guess) which coding-system is most probably for a plain text file. It's very easy to use unicad.el. Simply download and copy this file to your emacs loading path (like "site-lisp"), add following lines to your ~/.emacs:
(require 'unicad)
done.

It's supposed that the coding detection process will not interfere your regular edit tasks. If you found the speed of find-file is slowed down, you'd better byte-compile this file.

Hope you'll enjoy it.

Download page of unicad.el.

4 comments:

Anonymous said...

good job, I tried both your fontset-win.el and this newly published unicad.el, run smoothly with emacs23 on windows xp. I look forward to more useful tips or stuffs related to Emacs coming.

regards,
xingang

jasonal said...

Thanks :)

Anonymous said...

使用emacs作为文件管理器-dired,显示的目录名仍然是乱码的

jasonal said...

dired 选择的编码是用 set-file-name-coding-system 来控制的。
用 (set-file-name-coding-system 'gb18030) 试试看。
当然后面的值要和当前的系统编码一致