LoveIt icon indicating copy to clipboard operation
LoveIt copied to clipboard

[BUG] 阅读原始文档是乱码

Open yeahwong opened this issue 4 years ago • 6 comments

本地预览网站的时候,在浏览器打开「阅读原始文档」,中文正常显示;但部署到GitHub后,再在浏览器打开「阅读原始文档」,中文全是乱码。

请问这个问题,应该怎么解决?谢谢

yeahwong avatar Jun 15 '20 05:06 yeahwong

和你同样的问题,但是我在firefox浏览器里直接下载markdown文件阅读是正常的,而直接在浏览器里阅读就是乱码。在本地预览的时候则完全没有这种问题。

ghost avatar Jun 15 '20 22:06 ghost

找到一个解决办法,下载插件Set Character Encoding,然后在有问题的页面右键选择「Set Character Encoding>Unicode (UTF-8)」即可。

ghost avatar Jun 15 '20 22:06 ghost

image作者的原话。

ghost avatar Jun 15 '20 22:06 ghost

image作者的原话。

如何解决呢

yangzhaoyunfei avatar Jul 05 '20 12:07 yangzhaoyunfei

Set the right response header for *.md url on your http server, take caddy as an example:

part of my Caddyfile :)

   @markdown {
        path /*/*.md
    }

    header @markdown {
        content-type "text/markdown; charset=utf-8"
    }

windvalley avatar Oct 29 '20 08:10 windvalley

Same problem here while using github pages to deploy. Problem solved after deploying onto Netlify.

And the github pages team won't let you change *.md file header by far.

digevil avatar Mar 28 '23 07:03 digevil