grunt-contrib-sass: incompatible character encodings: UTF-8 and CP850

◇◆丶佛笑我妖孽 提交于 2019-12-09 01:37:51

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/16950900/grunt-contrib-sass-incompatible-character-encodings-utf-8-and-cp850

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!