本人打算在windows 7下,使用octopress搭建博客。
有一个问题不得其解:
cmd终端,使用chcp 65001, rake generate编译没有问题。
但是,用git bash终端,已经设置了变量如下:
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
LESSCHARSET=utf-8
rake generate产生下面问题:
octopress/plugins/backtick_code_block.rb:13:in
gsub': incompat ible character encodings: UTF-8 and GBK (Encoding::CompatibilityError) from octopress/plugins/backtick_code_block.rb:13:in
re nder_code_block'
from octopress/plugins/octopress_filters.rb:12:inpre_ filter' from octopress/plugins/octopress_filters.rb:28:in
pre_ render'
from octopress/plugins/post_filters.rb:112:inblock in pre_render' from octopress/plugins/post_filters.rb:111:in
each'
from octopress/plugins/post_filters.rb:111:inpre_rend er' from octopress/plugins/post_filters.rb:166:in
do_layou t'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/lib/jekyll/po
st.rb:195:inrender' from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/lib/jekyll/si te.rb:200:in
block in render'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/lib/jekyll/si
te.rb:199:ineach' from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/lib/jekyll/si te.rb:199:in
render'
from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/lib/jekyll/si
te.rb:41:inprocess' from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-0.12.0/bin/jekyll:26 4:in
'
from c:/Ruby200-x64/bin/jekyll:23:inload' from c:/Ruby200-x64/bin/jekyll:23:in
'
有谁可以帮忙分析一下,是怎么回事,git bash有等价cmd终端的chcp类似命令吗?
补充说明:
在当前git bash终端下,输入中文是没有问题的;同时中文问题只是发生在代码高亮模块里,其他位置的中文是没有这个情况的,如果不需要代码高亮,也是没有这个问题。
由于git bash终端基本上等同于cmd终端。
参照此文 http://www.soimort.org/posts/118/ 对windows终端有详细的说明。
由于我想在git bash上面操作,git bash提供了大部分linux习惯的命令。
写了一个脚本,
编译时暂时改为65001模式,编译之后恢复回当前的936模式。
@依云, 非常感谢,很热情,及时而且专业的support!!!