0

I've downloaded Ruby and installed Sass. I then installed Sass Build for Sublime Text 2 through the package manager but when I try to build my css file, nothing happens.

It says :

[Decode error - output not utf-8] [Finished in 0.1s with exit code 1]

Does anyone know how to fix this ?

user3292788
  • 407
  • 1
  • 6
  • 15
  • Why are you trying to build a `.css` file? – MattDMo Aug 14 '15 at 02:42
  • How would it work then ? – user3292788 Aug 14 '15 at 03:05
  • `sass` is a compiler that turns nice, pretty, fun-to-write [SASS/SCSS](http://stackoverflow.com/questions/5654447/whats-the-difference-between-scss-and-sass) into *functional* (but more difficult to write) [CSS](https://en.wikipedia.org/wiki/Cascading_Style_Sheets). So, you need some SASS or SCSS input to feed to the compiler, which (when set up properly) spits out CSS for your site. Visit the SASS website to learn how to download, install, and set up everything. The Package Control page for [`SASS Build`](https://packagecontrol.io/packages/SASS%20Build) is also helpful. – MattDMo Aug 14 '15 at 03:45
  • I appreciate the fact that you are trying to help me but we are totally off topic. I'm not a beginner and I know what is SASS and CSS :) I actually compile my SASS files with Koala after I had used Scout but I wanted to use the build system of ST to work faster. So my question was why when I try to build my CSS file, no file is beeing created. You can see a [similar issue in this topic](http://stackoverflow.com/questions/12448546/sublime-text-2-doesnt-save-built-sass-file) – user3292788 Aug 14 '15 at 07:30

1 Answers1

1

By default, the output encoding in a sublime build is utf-8. This will cause an error if there are non-utf-8 characters in your sass or scss.

You can create a custom sass .sublime-build along the lines of the following by going to Tools > Build System > New Build System.

{

    "cmd": ["sass", "--update", "$file:${file_path}/${file_base_name}.css", "--stop-on-error", "--no-cache"],
    "selector": "source.sass, source.scss",
    "line_regex": "Line ([0-9]+):",

    "osx":
    {
        "path": "/usr/local/bin:$PATH"
    },

    "windows":
    {
        "shell": "true"
    }

    "encoding": "cp1252"
}

Note the key (the only one that'll be surplus from the installed package) "encoding": "cp1252". Its value will have to match that of your source or be a superset thereof. There's a fairly comprehensive list of codecs in the Python docs.

Robin James Kerrison
  • 1,727
  • 1
  • 15
  • 26