forcing @charset

745 views
Skip to first unread message

Mark Volkmann

unread,
Aug 1, 2011, 1:11:51 PM8/1/11
to Sass
I have this line at the top of my .scss file:

@charset "UTF-8";

I want that line to appear in the generated CSS even if it is pure
ASCII because I'm checking my .css files with JSLint and it expects
that line.
Is there a way to tell Sass that I always want that line in the output?

Chris Eppstein

unread,
Aug 1, 2011, 1:55:29 PM8/1/11
to sass...@googlegroups.com
Add a utf-8 character to your files -- It can be in a comment.

chris


--
You received this message because you are subscribed to the Google Groups "Sass" group.
To post to this group, send email to sass...@googlegroups.com.
To unsubscribe from this group, send email to sass-lang+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sass-lang?hl=en.


Mark Volkmann

unread,
Aug 1, 2011, 2:13:05 PM8/1/11
to sass...@googlegroups.com
Thanks for the tip! I tried that, but it's not working. Maybe you'll
spot what I'm doing wrong. Here's what's at the top of my .scss file:

@charset "UTF-8";
// Force output of above line by adding a unicode character. ♫

Note the musical note character at the end of the comment line.
When I regenerate the .css file, it still doesn't contain the @charset line.

On Mon, Aug 1, 2011 at 12:55 PM, Chris Eppstein <ch...@eppsteins.net> wrote:
> Add a utf-8 character to your files -- It can be in a comment.
> chris
>
> On Mon, Aug 1, 2011 at 10:11 AM, Mark Volkmann <r.mark....@gmail.com>
> wrote:
>>
>> I have this line at the top of my .scss file:
>>
>> @charset "UTF-8";
>>
>> I want that line to appear in the generated CSS even if it is pure
>> ASCII because I'm checking my .css files with JSLint and it expects
>> that line.
>> Is there a way to tell Sass that I always want that line in the output?

--
R. Mark Volkmann
Object Computing, Inc.

Chris Eppstein

unread,
Aug 1, 2011, 2:49:06 PM8/1/11
to sass...@googlegroups.com
Sass is pretty smart about charsets. Try making it a loud comment:

/*!  Force output of above line by adding a unicode character. ♫ */


--

Mark Volkmann

unread,
Aug 1, 2011, 3:16:03 PM8/1/11
to sass...@googlegroups.com
Thanks! That fixed it. It also works with just a multiline, non-loud comment.
Reply all
Reply to author
Forward
0 new messages