Mardzis
Mardzis

Reputation: 768

How can I change charset in SASS (SCSS)

When working on web projects I'm using css preprocessor SASS with SCSS syntax. In the comments, I like to write what the following code does, I write comments in my language (in czech). Unfortunately, when you compile it throws me the error coding. I'm using for compilation app Koala.

Error msg by compilation:

 Error: Invalid US-ASCII character "\xC5" on line 7 
 of /Users/martinjinda/Documents/www/_welcome_screen/local/sass/main.scss 
 Use --trace for backtrace.

SCSS code:

 // ---------------------------------------------------------------------------
 // Import všech zdrojových souborů a následná kompilace do /css/main.css

 @import 'reset.scss';
 @import 'typo.scss';
 @import 'mixins.scss';
 @import 'layout.scss';
 @import 'content.scss';

Upvotes: 8

Views: 12176

Answers (2)

Klemart3D
Klemart3D

Reputation: 338

Since LibSass is deprecated, you must use Dart Sass instead. With it, you don't need to specify the input encoding because default (and only supported until now) is "UTF-8". I tried you're Sass code with Dart Sass and no error is returned!

Upvotes: 1

Pavelloz
Pavelloz

Reputation: 569

Try @charset "UTF-8"; on the beginning of file, before any spaces, comments.

Upvotes: 15

Related Questions