how to fix the “warped characters” issue in a haskell project? [closed]


Please briefly explain why you feel this question should be reported .

Report Cancel

i cloned this haskell-based blog project:

git clone blog-by-chromabits

i setup a blog successfully: ,but a post written in chinese has “warped characters”,the post is ,

how to fix this “warped characters” issue?

solved 0
1 Answer 37 views 0

Answer ( 1 )

  1. Anonymous
    January 12, 2017 at 9:30 am

    Please briefly explain why you feel this answer should be reported .

    Report Cancel

    Your website is encoded in UTF-8, and does in fact contain proper chinese text. Your problem is that the website doesn’t advertise that it is encoded that way, therefore any browser you’ll use will simply take an educated guess (which will often be wrong). For example, Chrome on Windows 10 picks Windows-1252 as the character encoding for me, which is of course wrong. A browser on linux might default to UTF-8 instead, so a user like that might not see anything wrong.

    A simple bandaid fix for this would be to simply state the encoding in the html header:

       <meta charset="utf-8">

    that will fix it for that page at least. Going forward you should set up your webserver to send the correct encoding in the HTTP header (it’s part of the Content-Type header field, see here for details).

    You can also tell your browser to use a particular encoding for a website to diagnose issues like this.

    Best answer

Leave an answer


What is the capital of Egypt ? ( Cairo )

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>