TransWikia.com

How to set utf-8 encoding for *markdown-output* buffer?

Emacs Asked by Volodymyr on September 2, 2021

I have emacs-24.5 installed on Windows 10. Many utilities are configured through cygwin, including perl. When in Markdown mode every so often after I press C-c C-c p to run the external markdown.pl against the buffer contents and open the resulting markdown-output buffer in the browser, I instead see the following:Incorrect encoding
The reason is that the original README.md file contains RIGHT SINGLE QUOTATION MARK character in UTF-8 format, which is the bytes E2 80 99, or 0x2019 code point in Unicode. markdown.pl interprets the character correctly in its output, I tried to run it from the command prompt and the resulting HTML is also in UTF-8 encoding.

Hence the question: how can I to configure markdown-preview function so as it sets markdown-output buffer coding system to utf-8 anytime I asked for markdown-preview?

One Answer

The fact that the top-right window shows those "characters" as 342200231 indicates that the file was incorrectly read from the disk. More specifically, Emacs apparently decided that this file does not contain utf-8 text but that it contains binary. This is usually due to a NUL byte somewhere within the file. You can search for it with C-s C-q 0 RET.

You might like to report this as a bug (i.e. the chars should not appear as 342200231 but as ).

Answered by Stefan on September 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP