Sublime Forum

SCSS, encoding compatibility error

#1

Hello. I’m a beginner using Sublime Text. I’m using version 3.1.1., build 3176, on macOS 10.12.6.

I’m trying to set up a simple site using SCSS with partials. I installed the SASS and SCSS packages (Sass, SASS Build and SCSS) and for testing purposes I created an empty .scss file. When I run the Build command, I get the following error on the console:

Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and US-ASCII

I’ve googled this and still haven’t found a solution. I was using Dreamweaver some time ago and I believe I solve a similar issue using @charset “UTF-8”; at the beginning of all scss files, but it doesn’t seem to work in this case.

I probably am failing at something basic. Can anyone help me out with this? Thank you.

EDIT: The problem seems to lie with the file path having characters like “ê” and “á”. I’m Portuguese and we have these accented characters. I’d still like to find a solution because I may not always have the option to rename folders.

0 Likes

#2

Can you run the necessary commands from the terminal/console?

0 Likes

#3

Hello. What do you mean by necessary commands? I believe I can run the commands from the console, the way I installed Package Control, for example.

0 Likes

#4

I believe what @FichteFoll meant was, if you open a MacOS Terminal App, go to the appropriate location on your file system and then manually execute the commands that the build system you’re using is doing, do you get the same results?

For example, if manually running the commands works but in Sublime it does not, then the next course of action is to figure out if there is some environment setup that the Terminal has that Sublime does not.

Conversely, if doing it manually also causes the same error, then the problem is with the command(s) or what they’re doing and not with Sublime, in which case the next course of action is to determine why the tool is doing that and how to fix it, which would also likely fix it in Sublime as well.

2 Likes

#5

Ah, thank you, that makes perfect sense. I’m not very used to using Terminal other than copying and pasting commands I find in forums. I’ll try to look for the commands that the build system uses and replicate them on Terminal.

0 Likes

#6

Hello again.

I tried your suggestion and made some progress, but haven’t solved the issue.

Using the Terminal, I first tested building a simple .scss file and then tried with my normal files. The build ran normally and produced the .css files correctly. I placed my files is on a folder on my Desktop, so there are no folders with special characters in the file path. In this case, the build works every time, both in Terminal and in Sublime Text 3.

However, when there are special characters in the file path - I changed the folder on my Desktop to “vivó” -, then the build still works correctly in Terminal every time, but in Sublime it works only if the output file does not exist. If it does exist, the build fails.

The command I used was:

sass --update /Users/joaosilva/Desktop/vivó/style.scss:/Users/joaosilva/Desktop/vivó/style.css --stop-on-error --no-cache

The complete error I got on the Sublime console when the build failed was:

/Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/importers/filesystem.rb:87:in index': incompatible character encodings: ASCII-8BIT and US-ASCII (Encoding::CompatibilityError) from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/importers/filesystem.rb:87:inremove_root’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/importers/filesystem.rb:146:in find_real_file' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/importers/filesystem.rb:32:inmtime’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/staleness_checker.rb:134:in mtime' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/staleness_checker.rb:163:inblock in dependency_updated?’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/staleness_checker.rb:81:in stylesheet_modified_since?' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/staleness_checker.rb:69:instylesheet_needs_update?’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/compiler.rb:211:in block in update_stylesheets' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/compiler.rb:209:ineach’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin/compiler.rb:209:in update_stylesheets' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/plugin.rb:82:inupdate_stylesheets’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/exec/sass_scss.rb:338:in watch_or_update' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/exec/sass_scss.rb:51:inprocess_result’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/exec/base.rb:50:in parse' from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/lib/sass/exec/base.rb:18:inparse!’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1@global/gems/sass-3.7.2/bin/sass:13:in <top (required)>' from /usr/local/bin/sass:23:inload’
from /usr/local/bin/sass:23:in <main>' from /Users/joaosilva/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:ineval’
from /Users/joaosilva/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `’
[Finished in 0.3s with exit code 1]
[cmd: [‘sass’, ‘–update’, ‘/Users/joaosilva/Desktop/vivó/style.scss:/Users/joaosilva/Desktop/vivó/style.css’, ‘–stop-on-error’, ‘–no-cache’, ‘–trace’]]
[dir: /Users/joaosilva/Desktop/vivó]
[path: /usr/local/bin:/Users/joaosilva/.rvm/gems/ruby-2.4.1/bin:/Users/joaosilva/.rvm/gems/ruby-2.4.1@global/bin:/Users/joaosilva/.rvm/rubies/ruby-2.4.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/joaosilva/.rvm/bin]

Any ideas about what might be happening and why? I’m really stumped here.

I would like to keep the folders with whatever names they have, regardless of special characters, because I work with different teams of various sizes and that call is not always mine to make. Also, it works fine on Terminal, so it should be solvable, right?

Thank you.

0 Likes