by shigemk2

当面は技術的なことしか書かない

emacsの文字コードを指定してみる


(set-language-environment "Japanese")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(setq file-name-coding-system 'utf-8)

追記:現行のemacsではエンコーディングを自動で設定してくれるので、この設定は不要というご指摘を頂きました。
そのため、

(require 'ucs-normalize)
(set-file-name-coding-system 'utf-8-hfs)
(setq locale-coding-system 'utf-8-hfs)

と書くとよろしいようです。