(mapconcat
(lambda (chr)
(setq uchr
- (if (setq ret (or (char-ucs chr)
- (get-char-attribute chr '=>ucs@gb)))
- (decode-char '=ucs ret)
- chr))
+ (cond ((setq ret (char-feature chr '=>ucs@gb))
+ (setq chr (decode-char '=ucs@gb ret)))
+ ((setq ret (char-ucs chr))
+ (setq chr (decode-char '=ucs@gb ret))
+ (if (setq ret (get-char-attribute chr '=>ucs*))
+ (decode-char '=ucs@gb ret)
+ chr))
+ (t chr)))
(char-to-string
(if (setq ret (encode-char uchr 'chinese-gb12345))
(decode-char 'chinese-gb2312 ret)
'ideo-translate-string-into-simplified-chinese)
;;;###autoload
+(defun ideo-translate-string-into-simplified-japanese (string)
+ "Simplify traditional Kanji characters in STRING."
+ (let (uchr ret)
+ (mapconcat
+ (lambda (chr)
+ (setq ret (or (char-feature chr '->simplified@JP/Jouyou)
+ (char-feature chr '->simplified@JP)
+ (char-feature chr '->simplified)))
+ (char-to-string
+ (cond ((car ret))
+ ((setq ret (char-feature chr '=>ucs@jis))
+ (decode-char '=ucs@jis ret))
+ ((setq ret (char-ucs chr))
+ (decode-char '=ucs@jp ret))
+ (t chr))))
+ string "")))
+
+;;;###autoload
(defun ideo-translate-region-into-traditional (start end)
(interactive "r")
(save-excursion