Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: current buffer's coding system

I have used to pc for developing erlang program, one is mac os x 10.6, the other is mac os x 10.7.

In ".emacs" file of both pc, it contain the following script

;;handle emacs utf-8 input
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

But when I input remark including Chinese characters in one pc and saved, and download to the other pc. The chinese characters can't be shown correctly. The same story for reverse operation.

I want to know how to check the current file's encoding type? Is there any command can do that?

like image 241
Chen Yu Avatar asked Jul 31 '12 00:07

Chen Yu


1 Answers

I believe you're looking for buffer-file-coding-system. M-x describe-variable will tell you more about it, and you can set it by M-x eval-expression and use (setq buffer-file-coding-system 'coding-system-i-want). That will set it for a single buffer; once you've got it working, you can add entries to file-coding-system-alist to permanently set the option as you'd like.

like image 50
Craig Citro Avatar answered Oct 26 '22 15:10

Craig Citro