GoogleChrome / GoogleChrome/lighthouse
CSS loaded as incorrect charset unless explicitly declared
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 19
Description
#### Provide the steps to reproduce
1. Run LH on https://shkspr.mobi/blog/
2. When the page reloads, the `✍` emoji incorrectly renders as `âœ`.
### Before LH

### After LH

#### What is the current behavior?
Why this occurs:
* My style.css contains `content: "✍";`
* It is served as `Content-Type: text/css;` with no charset.
* When the devtools reloads the page after Lighthouse runs, it corrupts the text - I think into Windows-1252
* If I add `@charset "UTF-8";` at the start of the CSS file, it renders correctly after Lighthouse runs.
#### What is the expected behavior?
[The CSS spec says](https://www.w3.org/TR/css-syntax-3/#input-byte-stream), if a text encoding can't be determined, assume UTF-8.
(I am unable to change the server to serve ` Content-Type: text/css; charset=utf-8`)
#### Environment Information
* Lighthouse version: Whatever ships with Chromium 78
* Chrome version: Version 78.0.3904.108 (Official Build) snap (64-bit)
* Operating System: Ubuntu
**Related issues**
Contributor guide
Assessment
This issue has not been assessed yet.