question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@charset stripped in :compressed output

See original GitHub issue

Yesterday I updated a project from 3.3 to 3.4 (specifically, 3.4.5), and it seems that @charset "utf-8"; is being stripped from files compiled using :compressed style. I do not believe this is the intended result.

Input

body {
  font-family: "漢字仮名交じり文", sans-serif;
}

Output (default)

sass input.scss output.css

@charset "UTF-8";
body {
  font-family: "漢字仮名交じり文", sans-serif; }

Output (compressed)

sass --style=compressed input.scss output.css

body{font-family:"漢字仮名交じり文", sans-serif}

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
atflickcommented, Apr 21, 2021

One buggy thing that I found on my app, which may just be a Chrome issue, but if you right click > inspect an element, then close the dev tools and navigate to another page, my icon font in my CSS file no longer gets properly decoded: image

should be: image

Manually adding the @charset "utf-8"; in the compiled css file prevents that. Wish I could manually add this in my scss files, but it gets stripped.

Likely a Chrome issue, but still, don’t want our QA team stumbling on this every so often

0reactions
kapooostincommented, Mar 23, 2019

But it causes all kinds of trouble when you later try to inline styles, for example when compiling html for email. BOM gets inserted in the middle of resulting email. Some clients ignore it, but Apple Mail shows weird question marks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compression and Encoding giving Wrong results in Strings
I'm using Base64 encoding and decoding to conversion of String to Bytes and viceversa. import org.apache.axis.encoding.Base64; import java.io.
Read more >
Display encoding - HTTPie 3.2.1 (latest) docs
It uses the encoding specified in the Content-Type charset attribute. ... Any leading dots are stripped from a server-provided filename.
Read more >
UTF What? A Guide for Handling SAS Transcoding Errors with ...
This will output a message to your log, telling you what encoding your SAS session is using. ... string=strip(compress(string,'00'x));.
Read more >
Differrent Character set and NLS - Ask TOM
US7ASCII for example is a 7bit character set, the high bit is "stripped". ... Unix output is in DD-MON-YYYY format while in windoes...
Read more >
GzipHandler (Jetty :: Project 9.4.46.v20220331 API) - Eclipse
Requests with a Content-Encoding header with the value gzip will be uncompressed by ... and efficient compression of the response on all Output...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found