Strotmann.de

Tuesday May 24, 2011

Changing the encoding in Emacs

From the 'note-to-myself' department: To change the text encoding of a file in Emacs, load the file and then press

CTRL+X RET f <encoding>

where <encoding> can be values like utf-8.

Comments:

You may want to put the following lines into your .emacs to keep you from having to manually specify encoding for new files:

(prefer-coding-system 'utf-8)

Also you can put an encoding comment at the top of any files so emacs uses that instead of the detected encoding. Example:

\ -*-coding:utf-8-*-

Posted by David on February 21, 2012 at 11:32 AM CET #

Post a Comment:
  • HTML Syntax: Allowed

Calendar

Feeds

Search

Links

Navigation

Info