CSS files with UTF-8 BOM triggers CSS errors
See original GitHub issueI noticed that if a CSS file has a UTF-8 BOM then HtmlUnit seems to not like it - It throws a CSS error:
com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'http://localhost:59425/cargo-daemon-webapp/cargo.css' [38:1] Error in style rule. (Invalid token "body". Was expecting one of: <S>, <LBRACE>, <COMMA>.)
The UTF-8 BOM doesn’t seem to “bother” Web browsers, could HtmlUnit also be updated to behave similarly?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to fix "Byte-Order Mark found in UTF-8 File" validation ...
Open the file with Geany. In the menu "Dokument" uncheck "Write Unicode BOM". Save the file. Save this answer.
Read more >Display problems caused by the UTF-8 BOM - W3C
Answer. If you are dealing with a file encoded in UTF-8, your display problems may be caused by the presence of a UTF-8...
Read more >CSS files encoded in UTF-8 with BOM break the design when ...
Problem/Motivation. If a css file is encoded in UTF-8 with BOM (byte order mark) it breaks the design when enabling css aggregation.
Read more >Ensure all script, css and html files are UTF-8 with BOM #266
So I propose to do a PR with the scripts conforming to UTF-8 encoding with BOM, so that this can be tested on...
Read more >Checking for boms in files - Get Started - SitePoint Forums
I just want to be sure. Right now, my PHP, HTML, JS, and CSS files are all saved in the UTF-8 Without BOM...
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
Ok, hopefully i have covered the most important cases. Please check twitter for a new snapshot build.
Many thanks for reporting this.
Yes this is the plan - removing the BOM is not so tricky (i already did it at some other places) but it will require some time to think about test cases to ensure the same behavior as real browsers.