I have a Markdown text file, utf-8-encoded, that has some non-ASCII characters such as ’
. I couldn't get the reference Perl implementation to handle these characters correctly, but I can get it work with Pandoc. I'd like to be able to render my Markdown file straight from Emacs, using C-c C-c p
from Markdown mode, and that's still not working for me. I get what looks like a blank space instead of the non-ASCII character. For example,
I love apostrophe’s.
turns into
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>I love apostrophe s.</p>
</body>
</html>
Note that the HTML contains charset=utf-8
. It's nearly identical to what I get running Pandoc from the command line, except for the missing apostrophe. I'm invoking Pandoc, whether from Emacs or the command prompt, using pandoc -f markdown -t html -s --mathjax --highlight-style pygments
, which I got from here.
Can I get the apostrophe and other unicode characters to render properly from Emacs?
EDIT: using the C-u C-x =
command that @db48x suggested, I verified that the blank character is a regular space (#x20)