首页 > 代码库 > Encoding::CompatibilityError: incompatible character encodings: GBK and UTF-8

Encoding::CompatibilityError: incompatible character encodings: GBK and UTF-8

在scss前面加上一句 @charset "utf-8";

这样就不会报错了, 解决方案参考 https://github.com/imathis/octopress/issues/232

试过改engin.ruby文件没有效果:

C:\Ruby\lib\ruby\gems\1.9.1\gems\sass-3.3.14\lib\sass

在这个文件里面engine.rb,添加一行代码(同方法1)

Encoding.default_external = Encoding.find(‘utf-8‘)

放在所有的require XXXX 之后即可, 还尝试加过下面这两行,也没反应.

LANG=en_US.UTF-8LC_ALL=en_US.UTF-8

Encoding::CompatibilityError: incompatible character encodings: GBK and UTF-8