How to reset emacs to save files in utf-8-unix character encoding?

后端 未结 3 472
忘掉有多难
忘掉有多难 2020-12-17 01:30

I have a problem. I found out that emacs recently stopped to save all my new files with the default character set \"utf-8-unix\". I do not understand what

3条回答
  •  情深已故
    2020-12-17 02:10

    For some reason, Windows started interpreting my init.el file as being encoded in something other than UTF-8, and choked on characters such as "ö" and "§". The solution was to add a line ; -*- coding: utf-8 -*- at the start of the file.

    To make very sure that UTF-8 is used in every case, I have the following lines in init.el:

    ;; Use UTF-8 for all character encoding.
    (set-language-environment 'utf-8)
    (set-default-coding-systems 'utf-8)
    (set-selection-coding-system 'utf-8)
    (set-locale-environment "en.UTF-8")
    (prefer-coding-system 'utf-8)
    (setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding
    

提交回复
热议问题