I have an HTML document that looks like this:
<h2 id="rendering-issue">Render: em dash, quotes, apostrophe, ampersand</h2>
<p>I’m dashing — “quoting” & more!</p>
This renders correctly, opened in my browser.
In my GitHub Pages, ditto.
But on my GoDaddy-hosted site, not
I generated this HTML by running Markdown through the vscode-pandoc extension and I find that if I go through the HTML doc and find/replace the em dash with —
—and replace things like “ with " —that does work for GoDaddy.
I did call them, but was told that, tho they do host HTML sites, their tech support extends only to WordPress... And it was suggested that there might be something wrong with my HTML.
I will look for other hosting arrangements, so you can skip that advice!
Kind of things I'd like to know:
VSCode seemed to know to replace & with &
— shouldit have replaced the em dash with —
and the curved quotes for me?
Is there a setting to make it do this? Does a different extension do it?
Is this just due to a known difference in the way sites or hosts parse HTML?
Could there be anything malicious causing this?
Tnks!
You data is in the multibyte encoding UTF-8 without a BOM. Encoding sent by the last is windows-1252 so you can see 3 bytes for some symbols, you view the multibyte as unibyte.
To set the correct encoding one can use the Content-type HTTP header
Content-Type: text/html; charset=utf-8
or the meta charset inside HTML
<meta charset="UTF-8">
There is double quotes (") unibyte, open double quote (“) and close double quote (”) that require 3 bytes each. There is a lot of others like simple quote ('), open simple quote (‘) and close simple quote (’).