PHP-CSS-Parser
PHP-CSS-Parser copied to clipboard
UTF-8 byte order mark (BOM) not stripped
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?
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).