Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compass compile wrong with Unicode character

Compass compiled everything well if I didn't put a @charset "UTF-8"; in my root scss, its output like this:

@charset "IBM437";

my css output still keeps the right Unicode character, just like this:

content: "ĐĂNG";
content: "TRẢ LỜI";

Its css still work with Chrome and Firefox but fail in IE because it didn't render the Unicode character and the output will completely be wrong if I put @charset "UTF-8";

content: "─É─éNG";
content: "TRẢ LỜI";

At this time, with just two properties use Unicode characters, I can still modify it but if I have more Unicode characters, it would be a nightmare. Do I need to modify config.rb?

like image 715
Raphaël VO Avatar asked May 14 '26 22:05

Raphaël VO


2 Answers

If You import files with @import, also declare @charset "UTF-8"; in the first line of root file ( for example styles.scss ) - it helped me.

like image 60
neatcoding Avatar answered May 18 '26 20:05

neatcoding


Your source file is encoded using IBM437 instead of UTF-8, so Sass adds an appropriate @charset declaration in your output files. Try to save your files using the UTF-8 charset.

like image 42
piouPiouM Avatar answered May 18 '26 18:05

piouPiouM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!