Windows8上的Jekyll有UTF8错误

时间:2015-04-30 08:22:19

标签: utf-8 jekyll

谢谢!我在windows9上安装了jekyll,但是当我在中文博客上提供jekyll时,它显示utf8错误,但是当我在仅限英文的博客上提供jekyll时,它可以工作! 这是我的截图

Zepu @ ZEPUXI / E / Github / utf8(主)

$ jekyll serve

Configuration file: e:/Github/utf8/_config.yml

        Source: e:/Github/utf8
   Destination: e:/Github/utf8/_site
   Generating...
   Error reading file e:/Github/utf8/_posts/2015-04-11-jekyll_on_windows.md: invalid 
  byte sequence in UTF-8
  jekyll 2.4.0 | Error:  invalid byte sequence in UTF-8

这是一个英文博客截图

$ jekyll serve
Configuration file: e:/Github/rifyll-master/rifyll-master/_config.yml
        Source: e:/Github/rifyll-master/rifyll-master
   Destination: e:/Github/rifyll-master/rifyll-master/_site
  Generating...
                done.
 Please add the following to your Gemfile to avoid polling for changes:
 gem 'wdm', '>= 0.1.0' if Gem.win_platform?
 Auto-regeneration: enabled for 'e:/Github/rifyll-master/rifyll-master'
 Configuration file: e:/Github/rifyll-master/rifyll-master/_config.yml
 Server address: http://0.0.0.0:4000/
 Server running... press ctrl-c to stop.

所以我的中文博客_config.yml就在这里:

encoding: UTF-8

# Dependencies
markdown:            rdiscount
highlighter:         pygments


# Permalinks
#
# Use of `relative_permalinks` ensures post links from the index work
permalink:           pretty
relative_permalinks: true

我如何解决这个问题?谢谢!!!

1 个答案:

答案 0 :(得分:0)

您能否检查一下您的文件e:/Github/utf8/_posts/2015-04-11-jekyll_on_windows.md是否有BOM

  1. 进入你的文本编辑器,我们的IDE设置了一个文件编码的loock。是 一定要选择utf-8no BOM(记事本++做得很好)。
  2. 保存文档
  3. Jekyll serve --trace