grunt-contribass:不兼容的字符编码:UTF-8和CP850 [英] grunt-contrib-sass: incompatible character encodings: UTF-8 and CP850

查看:937
本文介绍了grunt-contribass:不兼容的字符编码:UTF-8和CP850的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试使用grunt将我的sass文件转换为正常的css文件时,我收到警告:

 警告: :CompabilityError:不兼容的字符编码:UTF-8和CP850。然而,当我运行sass调用文件时,一切都工作,因为它应该,即使没有编码是由我指定。我的 Gruntfile.js 看起来像这样:

  
sass:{
main:{
file:{
'css / theme / default.css':'css / theme / source / default.scss',
'css / theme / beige.css':'css / theme / source / beige.scss',
'css / theme / night.css':'css / theme / source / night.scss',
'css / theme / serif.css':'css / theme / source / serif.scss',
'css / theme / simple.css':'css / theme / source / simple.scss' ,
'css / theme / sky.css':'css / theme / source / sky.scss',
'css / theme / moon.css':'css / theme / source / moon。 scss',
'css / theme / solarized.css':'css / theme / source / solarized.scss',
}
}
}
[。 ..]

这是 Gruntfile.js 我从GitHub上的reveal.js分支。我查看了GitHub上的 grunt-contribassa ,并尝试找到选项以更改编码手动。但是它似乎没有(也许我只是忽略了它?)。
我认为一个keypart的问题是,我使用Windows 8,而不是任何基于Unix的操作系统。



所以我的问题是:
我摆脱这个警告?或者我如何修复代码以正常工作?

解决方案

尝试使用命令时出现此错误:

  sass --watch global.scss:global.css --style compressed 

原因是最愚蠢的原因...我有这个文件夹: E:\Dropbox [Websites] [External]FundaciónGlobal\css ,我在那里运行命令,SASS返回了同样的错误:警告:Encoding :: CompabilityError:不兼容的字符编码:UTF-8和CP850。


我只需要从文件夹的路径中取出ó



这简单而愚蠢!刚刚更改了这一点: ... Fundacion Global \ css 为此 ... Fundacion Global\css ,我已经SASS观看了,没有任何问题。


While trying to use grunt to convert my sass files into normal css files i get the warning:

Warning: Encoding::CompabilityError: incompatible character encodings: UTF-8 and CP850.

However when I run sass calling the file(s) everything works as it should even though no encoding is specified by me. My Gruntfile.js looks like this:

[...]
sass: {
    main: {
        files: {
            'css/theme/default.css': 'css/theme/source/default.scss',
                'css/theme/beige.css': 'css/theme/source/beige.scss',
            'css/theme/night.css': 'css/theme/source/night.scss',
            'css/theme/serif.css': 'css/theme/source/serif.scss',
            'css/theme/simple.css': 'css/theme/source/simple.scss',
            'css/theme/sky.css': 'css/theme/source/sky.scss',
            'css/theme/moon.css': 'css/theme/source/moon.scss',
            'css/theme/solarized.css': 'css/theme/source/solarized.scss',
            }
        }
    }
[...]

which is a part of the Gruntfile.js I forked from the reveal.js on GitHub. I took a look at the grunt-contrib-sass on GitHub and tried to find the option to change the encoding manualy. However it apears that there is none (maybe I just overlooked it?). I think a keypart of the problem is that I am using Windows 8 and not any Unix based OS.

So my question is: How do i get rid of this warning? Or how do i fix the code to work properly? Any help is appreciated.

解决方案

I had this error when trying to use the command:

sass --watch global.scss:global.css --style compressed

And the cause was the most stupid cause ever... I had this folder: E:\Dropbox[Websites][External] Fundación Global\css and I run the command in there, and SASS returned this same error: Warning: Encoding::CompabilityError: incompatible character encodings: UTF-8 and CP850.

I just needed to take out the ó from the folder's path!

That simple and silly! Just changed this: ...Fundación Global\css for this ...Fundacion Global\css and I have SASS watching with no issues again.

这篇关于grunt-contribass:不兼容的字符编码:UTF-8和CP850的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆