windows - Sublime Text 3 上的 SASS - [解码错误 - 输出不是 utf-8]

标签 windows character-encoding sass sublimetext3

我今天一直在尝试在 sublime text 3 中使用 sass,为此我安装了 Ruby、Ruby SASS gem 和 Sublime 包 Sass 和 Sass Build。一切似乎都运行良好,但是当我尝试构建 css 文件(使用 Sass 构建包)时,我得到了这个奇怪的错误:

[Decode error - output not utf-8]
[Finished in 0.1s with exit code 1]
[cmd: ['sass', '--update', 'F:\\Program Files (x86)\\wamp\\www\\singlepage\\wp-content\\themes\\manaca\\style.scss:F:\\Program Files (x86)\\wamp\\www\\singlepage\\wp-content\\themes\\manaca/style.css', '--stop-on-error', '--no-cache', '--style', 'compressed']]
[dir: F:\Program Files (x86)\wamp\www\singlepage\wp-content\themes\manaca]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;F:\Program Files (x86)\MacType;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\]

当我尝试构建压缩的 CSS(来自同一个包)时,它只是返回

[Decode error - output not utf-8]
[Finished in 0.1s]

一直困扰我的是最后一行返回的疯狂文件路径(甚至不应该在 C: 中搜索)

我一直在研究的另一件事是 output not utf-8 事情。即使我在我的 sass(或 scss)文件中指定了字符集,问题仍然存在。

无论如何,我很感激能得到的任何类型的帮助。

最佳答案

"shell": true - 这是关键。

如果我尝试这样构建系统(在 WinXP 上):

{
    "cmd": ["ant", "-f", "project-build.xml"],
    "working_dir": "${project_path}"
}

我得到: [解码错误 - 输出不是 utf-8]
因为 cmd 应该是 "ant.bat"。 Sublime 正在寻找名为 ant 的文件并且 "file does not exist" 消息的编码不是 utf-8。 当我这样使用 shell 时:

{
    "cmd": ["ant", "-f", "project-build.xml"],
    "working_dir": "${project_path}",
    "shell": true
}

一切正常(即使没有 "windows": { "cmd": ....} )因为 shell 搜索 ant.exe 然后 ant.bat.

关于windows - Sublime Text 3 上的 SASS - [解码错误 - 输出不是 utf-8],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21068832/

相关文章:

c - 通过引用传递指针数组

java - 如何在 Java 中更改 HTTP 响应中的字符集编码

unicode - 关于字符编码的问题

sass - gulp minify-css清除scss文件中的注释

windows - Git:在 Windows 中协调两个具有重复名称(大小写不同)的文件夹,同时保留历史记录

c++ - 在类 Base 中实现函数的最有效方法

css - 本地化/作用域 sass mixin

ruby - sass @import "compass/reset"错误

c++ - Windows 线程创建期间的内存管理

visual-studio - 将 Visual Studio 项目中的所有文件保存为 UTF-8