Modify the encoding format of an existing file in Emacs

Source: Internet
Author: User
A few days ago, the default encoding format of Emacs was reset by setting the encoding format of the emacs file system.
But there are some problems. When some files were not encoded using a UTF-8, emacs opened with a UTF-8 by default, causing confusion. For example, my muse file is encoded.

Chinese-iso-8bit

(I don't know why muse uses this encoding). Now, as soon as Emacs opens the muse file, it is garbled.
Although I can use M-x revert-buffer-with-coding-system to re-read the file normally with the specified encoding (here is the chinese-iso-8bit, but because I set the default encoding as a UTF-8, after the muse document is published as a web page, the garbled problem still exists.
After practice, we found that the best solution is to change the muse document encoding to the UTF-8 encoding format. In fact, now we have no reason not to use UTF-8 encoding!
To modify the encoding format of an existing file that is displayed as garbled characters, follow these steps:

Run the M-x revert-buffer-with-coding-system command to re-read the file with the specified encoding for normal display;
Run the M-x describe-coding-system command to check whether the current file format is the same as the default UTF-8;
If not, use the C-x <RET> C (m-x universal-coding-system-argument) command to set the encoding format for the next operation. We set it to the UTF-8, then run the c-s command to save the current file.

In this way, the task of modifying the current file encoding format is completed.
OriginalArticle, Such as reprint Please note: Reprinted from the hammer details [http://blog.WaterLin.org/[...]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.