LoveIt
LoveIt copied to clipboard
[BUG] 阅读原始文档是乱码
本地预览网站的时候,在浏览器打开「阅读原始文档」,中文正常显示;但部署到GitHub后,再在浏览器打开「阅读原始文档」,中文全是乱码。
请问这个问题,应该怎么解决?谢谢
和你同样的问题,但是我在firefox浏览器里直接下载markdown文件阅读是正常的,而直接在浏览器里阅读就是乱码。在本地预览的时候则完全没有这种问题。
找到一个解决办法,下载插件Set Character Encoding,然后在有问题的页面右键选择「Set Character Encoding>Unicode (UTF-8)」即可。
作者的原话。
作者的原话。
如何解决呢
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"
}
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.