A front end in emacs to convert between simplified and traditional Chinese with opencc or cconv.
Author: Cong Gu
Put the following into init file (e.g.
Put chinese-conv.el into desired location (e.g.
and put the following into init file (e.g.
(add-to-list 'load-path "~/.emacs.d/site-lisp") (require 'chinese-conv)
Use opencc as backend (Default)
To change opencc program path, set
chinese-conv-opencc-program (default: "opencc"),
(setq chinese-conv-opencc-program "/PATH/TO/BIN/opencc")
To change opencc data directory, set
chinese-conv-opencc-data (default: "/usr/share/opencc/"),
(setq chinese-conv-opencc-data "/PATH/TO/DATA/")
Use cconv as backend
Set the backend to cconv,
(setq chinese-conv-backend "cconv")
To change cconv program path, set
chinese-conv-cconv-program (default: "cconv"),
(setq chinese-conv-cconv-program "/PATH/TO/BIN/cconv")
后天 is the string to convert. The interactive command will guess it
from marked region or current word.
traditional is the conversion type. It is read with completion among all the
available types. Hit
TAB for a complete list of available types.
The result will be displayed in minibuffer.
Example: Mark the region to be converted in the buffer, then
The marked region will be converted to traditional characters.
(chinese-conv "后天" "traditional") => "後天"
Backend can be explicitly specified,
(chinese-conv "后天" "traditional" "opencc") => "後天"