hexo-server icon indicating copy to clipboard operation
hexo-server copied to clipboard

Garbled code will be generated if .md file contains too many Chinese characters

Open yangg opened this issue 9 years ago • 7 comments

This issue is originally posted at https://github.com/ahonn/hexo-theme-even/issues/46

I have the same problem, Here is the md file https://raw.githubusercontent.com/yangg/blog/master/source/_posts/weixin-app.md

yangg avatar Nov 18 '16 01:11 yangg

Hmmm, definitely an issue. But is it the rendering issue or the server issue?

https://github.com/hexojs/hexo/issues/2171

NoahDragon avatar Nov 18 '16 15:11 NoahDragon

It renders correct after deploy, so I file the issue here.

yangg avatar Nov 19 '16 02:11 yangg

mark 遇到同样的问题,好疑惑

tanchao90 avatar Dec 24 '16 12:12 tanchao90

Sometimes the 'over-flooded' Chinese characters just get cut out, instead of being replaced by random symbols.

DMXL avatar Mar 23 '17 06:03 DMXL

Still got the same result on hexo: 3.3.1 when rendered in the localhost, but it's rendered correctly on github.

It seems that the response is corrupt. The end of response body seems to be truncated and mixed up with some, e.g.:

 <script type="text/javascript" src="/ "undefined" && _ctx.name !== null) ? ((typeof _ctx.name !== "undefined" && _ctx.name !== null) ? _ctx.name : "") : ((typeof name !== "undefined" && name !== null) ? name : "")) !== null ? ((t

It should be something like:

<script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>

instead.

resettingmq avatar Apr 23 '17 10:04 resettingmq

This's actually a regression caused by commit 4103a759e406ed4d9cda123ae6afe8a77f8f9432.

By enabling the compression can quickly avoid this problem:

server:
  compress: true

wayou avatar Jun 09 '17 05:06 wayou

The solution of @wayou is actually correct. But the description seems inconsistent with code? disabling or enabling?

mcfatealan avatar Jul 03 '17 02:07 mcfatealan