以下是我尝试过的事情:
向缓冲区添加注释:#-*- coding: utf-8; -*-
M-x M-m c,从列表中选择utf-8
,然后 M-xbase64-decode-region
。
这是缓冲区显示的内容:\327\252\327\234 \327\220\327\221\327\231\327\221
。它应该显示为תל אביב
。源字符串看起来像这样:16rXnCDXkNeR15nXkQ==
base64-decode-region
之后调用decode-coding-region
。(defun base64-decode-utf8-region (start end)
(interactive "r")
(save-restriction
(narrow-to-region start end)
(base64-decode-region (point-min) (point-max))
(decode-coding-region (point-min) (point-max) 'utf-8)))
(defun base64-encode-utf8-region (start end)
(interactive "r")
(save-restriction
(narrow-to-region start end)
(encode-coding-region (point-min) (point-max) 'utf-8)
(base64-encode-region (point-min) (point-max))))
C-x RET c
吗?你尝试过反过来吗?先解码,然后切换到 UTF-8。 - Olaf Dietsche