3 ms·
Ask HN Admins: Please indicate charset (UTF-8) inside your HTML
Dear HN Admins:
Would you please modify the web pages generated by Hacker News so that they indicate the content type internally, especially the encoding? In other words, would you please add the following tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
to your web pages' HEAD section?
My personal interest in this is to improve the Hourly Hacker News Snapshot (http://hhn.domador.net). For a long time, the archived pages frequently included a few gibberish characters when loaded from a web browser. (Smart quotes were the kind of characters that were most often displayed improperly.) I decided to finally get around to fixing this. I've modified my web server so that it indicates the UTF-8 charset in the HTTP headers. (EDITED SECTION)
There are probably others who would benefit from this change as well. What do you think?
-----
(EDIT: I removed the following text, when I found out that CloudFlare DOES pass along the Content-Type:
"Unfortunately, this solution is a bit limiting. I can no longer use CloudFlare to cache my website (since I can't customize CloudFlare to specify the Content Type). I could reprocess and hack the old pages to add the Content-Type section, but I'd prefer to modify the content I download as little as possible.")
- mooism2 12y agoWait, CloudFlare doesn't pass through the content-type from your web server?
- domador 12y agoMaybe it does. I'll have to run some further tests and get back to you on this. (So far, though, I've had to disable CloudFlare's cacheing to get the pages to display correctly.)
- deleted 12y ago[deleted]
- domador 12y agoOK, it looks like CloudFlare DOES pass along the content-type. (Sorry, CloudFlare. You're even better than I realized!) I think it'd still be helpful to include the content-type in the HTML, nevertheless.
- kogir 12y agoWe correctly set the Content-Type header: Content-Type: text/html; charset=utf-8 Is that not sufficient? If you set it as well (and it appears you do), then everything should work just fine.