Bug: character encoding #468

Closed
collimarco opened this Issue Aug 2, 2012 · 5 comments

Projects

None yet

4 participants

@collimarco

I am working with Sass 3.1.20 (Brainy Betty) and Rails 3.2.6.

I have a mixin with an em dash:

@mixin test {
  &:before {
    content: " — ";
  }
}

I use it as follows in another file:

@import 'mixins';
ul li {
  @include test;
}

I got something like â€", while everything works when I use:

ul li {
  &:before {
    content: " — ";
  }
}

UPDATE:
@nex3 Those solutions doesn't work. (but I cannot reopen because I don't have permission...)

@mguth
mguth commented Aug 3, 2012

Same problem here, started to surface after upgrading to Sass 3.2.

p
    margin: 0
    &:before
      content: "“"

outputs “

@nex3
Contributor
nex3 commented Aug 3, 2012

This sort of thing depends heavily on your system configuration. If you're using Rails, make sure that Encoding.default_external is set to the encoding you use in your Sass files; if you're using Sass from the command line, make sure that your system encoding configuration is set appropriately. You can also use the @charset directive at the top of your Sass file to manually declare what encoding you're using.

If neither of those solutions work, feel free to re-open this.

@nex3 nex3 closed this Aug 3, 2012
@tobiasmuecksch

@nex3 Hey there. I'm on sass 3.1.20 and I've got this problem on my mac too. I tried to set @charset "UTF-8"; at the top of my Sass files, as my editor saves all files in UTF-8, but it didn't make any difference.

By the way: collimarco said this already 2 years ago (by editing his issues). As far as I can tell we are not able to reopen the issue as you suggested.

@nex3
Contributor
nex3 commented Feb 27, 2014

Sass 3.1.20 is very old; the first thing to do is update to the most recent version (3.2.14).

If that doesn't work, run ruby -e "p Encoding.default_external" and let me know what that prints. Also, please provide minimal examples of files that demonstrate the issue, as well as the output you're getting.

@nex3 nex3 reopened this Feb 27, 2014
@tobiasmuecksch

@nex3 Thanks for your advice. I'm sorry i caused you to reopen this issue. It wasn't an encoding problem in my case. I've opened another issue #1141 describing my problem. Thanks anyway. Feel free to delete my obsolete comments in this issue.

@nex3 nex3 closed this Feb 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment