Sass compiler ignoring @charset
See original GitHub issueThe attached ZIP (SCSSS.zip) has a SCSS file named inow.scss
.
The file inow.css
has a @charset 'UTF-8';
directive. There’s an import named _grid.scss
. Later, I also included @charset
in imports too.
In an environment with default US-ASCII charset, SASS compiler won’t compile it.
It generates the following error:
Error: Invalid US-ASCII character "\xC3"
on line 106 of includes/_grids.scss
from line 26 of inow.scss
Use --trace for backtrace.
The problem is on line 106 of includes/_grids.scss
. It has a letter with an accent (in a comment).
I could reproduce it locally in a Windows machine by using -E US-ASCII
option.
The command-line used to reproduce was: sass --scss -t expanded -E US-ASCII inow.scss inow.css
.
I believe the compiler should respect the @charset
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Jekyll Sass converter ignores @charset - Stack Overflow
Jekyll's Sass converter is ignoring the @charset "UTF-8"; declaration at the very beginning of style.scss file after compiling to css.
Read more >Compile Sass to CSS with sassc so as to alphabetize selectors and ...
Attempting to match CSS compiling results of a themer we are working with— alphabetical selectors and UTF-8 encoding. sass compile “alphabetical” special ...
Read more >Sass converter ignores @charset ?
Sass converter ignores @charsetlink Sass keeps the @charset declaration only if needed (non-ASCII character in your file).
Read more >Dart Sass Command-Line Interface
When compiling whole directories, Sass will ignore partial files whose names begin ... This flag tells Sass never to emit a @charset declaration...
Read more >Theme files are shipped with the UTF-8 encoding starting with ...
In v20.2 we migrated to SASS. The SASS compiler always creates files with the UTF-8 encoding. If a file has non-ASCII characters, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sass uses
@charset
rules in the input files to determine the character set of those files. However, it doesn’t output a@charset
rule unless the output file actually has non-ASCII characters, since it doesn’t do anything otherwise.Sorry, seems like I was mistaken. It’s Ruby Sass 3.7.4 issue,