PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

UTF-8 byte order mark (BOM) not stripped

Open westonruter opened this issue 6 years ago • 1 comments

I was debugging an issue with @font-face not being recognized as an at-rule. It turned out to be because there was a UTF-8 BOM (\uFEFF) at the beginning of the CSS file and this was tripping up the parser. I assume this should be stripped when parsing, correct? Would this be part of improved @charset handling?

westonruter avatar Nov 20 '18 19:11 westonruter

Yes, BOM handling was part of the work on #116 and when we revisit that, we’ll surely handle the BOM gracefully. I think in general the BOM contains useful hints about the charset of the file in question (especially if @charset is missing or conflicting).

sabberworm avatar Nov 20 '18 21:11 sabberworm