Closed Bug 241027 Opened 22 years ago Closed 22 years ago

When page saved with UTF-8 encoding CSS does not work correctly

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dimka, Assigned: dbaron)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 if page encoding is changed to UTF-8 CSS will break Reproducible: Always Steps to Reproduce: 1. create a page and use link CSS file 2. make sure that it is all work correctly 3. change html file's encoding to UTF-8 and save with UTF-8 encoding Actual Results: CSS virtually does not work correctly Expected Results: the page should look exactly like before, changing the encoding should not influence how it works it appears that it is only broken in Mozilla browsers, IE does not have this problem you can compare two pages http://dimka.com/fonts/verdimka/default-ru.html and http://dimka.com/fonts/verdimka/default.html
Your CSS has no charset in the HTTP header. It has no @charset rule. The linking element does not say what encoding it's in. So we assume it's in the same encoding as the linking document (which is UCS-2 in this case, NOT UTF-8). It's clearly not a valid CSS stylesheet when parsed as UCS-2. See http://www.w3.org/TR/CSS21/syndata.html#q23 for how a browser is supposed to determine the character set of a stylesheet. With your sheet, we end up at step 4. So our behavior is in fact correct. If you don't want the parsing of the sheet to depend on the linking document, send an HTTP header or add a @charset rule.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
*** Bug 326289 has been marked as a duplicate of this bug. ***
*** Bug 327022 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.