Default encoding for CSS is Latin1 instead of UTF-8
Reported by
apisa...@yandex-team.ru,
May 30 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0 Steps to reproduce the problem: 1. Open test-css-circel.html in browser What is the expected behavior? CSS loading with UTF-8 encoding and ::before display circel What went wrong? CSS load with windows-1252 encoding and :: before display a like symbol. Did this work before? N/A Chrome version: 59.0.3071.0 Channel: canary OS Version: OS X 10.12 Flash Version: Shockwave Flash 25.0 r0 This bug is caused by this code https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp?l=139 But CSS standard saying next https://www.google.com/url?q=https%3A%2F%2Fwww.w3.org%2FTR%2FCSS2%2Fsyndata.html%23charset&sa=D&sntz=1&usg=AFQjCNG-ILXv6w0I30hbseU8UxepBxQs8w
,
May 30 2017
Ok, I check it and this test case didn't use the default value from the function. But if I open dev tools it will, because of another bug with loading of CSS in dev tools (I fixing it here https://codereview.chromium.org/2912973002/).
,
May 30 2017
,
May 31 2017
Are you opening the file from an HTTP server or local file? If so, probably the same as issue 550426 (w/o BOM or sniffing, documents loaded are loaded as windows-1252), i.e. working as intended. Also, try logging document.characterSet after loading the page to see what encoding was used for the document.
,
Jun 1 2017
I open local file and document.characterSet contains windows-1252. And this is the reason of incorrect encoding. But when I open dev tools document.characterSet contains <null>. So, for file used default encoding. I have no access to issue 550426 and can't say anything about it.
,
Jun 1 2017
Ah, sorry about issue 550426 - should be visible now. (It just had automatic view restrictions applied since a googler filed it.) Can you clarify what you mean by "when I open dev tools document.characterSet contains <null>" and the bug you're trying to fix in https://codereview.chromium.org/2912973002/ ?
,
Jun 2 2017
When I open dev tools, a special code to load CSS fired. And this way of loading didn't use HTML file encoding. So CSS encoding stays not set (<null>) and used default one(windows-1252). This isn't what I expect.
,
Jun 9 2017
Can you clarify where this appears in devtools? When I load the page I see: â—test Loading the CSS file on its own as UTF-8: content: '●'; In the devtools Source tab I see: content: 'â—'; (Although the shows up as a red circle - see attached image) Thanks for your patience here; I want to make sure we treat the bug accurately.
,
Jun 13 2017
Ok, I finally figure out how it can be reproduced. I attach fixed test files. Need to open test-css-circle.html with a browser. After that open dev tools and go to Sources > external.css. You will see content: 'â—'; But in any other place will be ●. Page refresh fixes it.
,
Jun 19 2017
Cool, thanks for the update. I see '●test' as the page content with the latest repro, and 'â—' (but with a red circle for some reason) in Sources > external.css
,
Nov 20 2017
Aside: the red circle is a devtools representation of control code \x8F in the C1 range which is not remapped to a non-control character by windows-1252. Other C0 and C1 control codes not given special meaning by Chrome are displayed similarly in some devtools UI (e.g. input editor in the console.) Note that the appearance typically switches to an outlined box or the glyph for the replacement character in other contexts (e.g. history lines in the console.)
,
Nov 21
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by bzbar...@mit.edu
, May 30 2017