

Ask HN Admins: Please indicate charset (UTF-8) inside your HTML - domador

Dear HN Admins:<p>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:<p>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text&#x2F;html; charset=utf-8&quot;&#x2F;&gt;<p>to your web pages&#x27; HEAD section?<p>My personal interest in this is to improve the Hourly Hacker News Snapshot (http:&#x2F;&#x2F;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&#x27;ve modified my web server so that it indicates the UTF-8 charset in the HTTP headers. (EDITED SECTION)<p>There are probably others who would benefit from this change as well.  What do you think?<p>-----<p>(EDIT: I removed the following text, when I found out that CloudFlare DOES pass along the Content-Type:<p>&quot;Unfortunately, this solution is a bit limiting.  I can no longer use CloudFlare to cache my website (since I can&#x27;t customize CloudFlare to specify the Content Type).  I could reprocess and hack the old pages to add the Content-Type section, but I&#x27;d prefer to modify the content I download as little as possible.&quot;)
======
kogir
We 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.

------
mooism2
Wait, CloudFlare doesn't pass through the content-type from your web server?

~~~
domador
OK, 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.

