Styles taken / replaced by Chinese characters

Well, something just went crazy. If China does not start with my style.css test file on my iepage - well, I think they start hating IE with their right foot, but anyway. It loads without a stylesheet - sad :( I go to the web inspector and see that all my related files are filled with [maybe] Chinese characters (瑨 汭 笠 ऊ 楷 瑤 ...) I tried to delete the files on the server and reloading them. Local files look great and they look great when downloading files directly. I didn’t do anything that was supposed to change the rendering or anything else.

+8
html
source share
2 answers

So, I think I get it. This is strange. But anyway.

I copied and pasted your HTML into a local file for experimentation. And it booted just fine. It was saved as UTF-8. Then I replaced it with UTF-16, and I got exactly what you see! As far as I can tell, the browser (Firefox for Linux for me) assumes that the linked files are all in one encoding, like HTML ...

So - I assume that the file on the server is in UTF-16, and if you change it to UTF-8, you should be fine. Hope this fixes!

PS: According to Firebug, your HTML is compressed by your server, even if you never explicitly talked about it. Fortunately, this does not seem to cause problems.

+8
source share

I ran into the same problem with XML files exported from PowerShell that were built into iFrames.

There was no problem with IE10 / 11 or Edge, but Firefox and Chrome did not load the stylesheet.

The original iFrames page load was encoded in UTF8, the same with the style. However, the XML file was exported to UTF16LE (Unicode in PowerShell). When the XML file was loaded from iFrame, it loaded the stylesheet as Chinese characters.

I converted the encoding to PowerShell ...

Get-Content C:\foldername\file.html -Encoding Unicode | Set-Content -Encoding UTF8 C:\foldername\file.html 

... and it worked! I assume that IE should treat the encoding of all files in the same way as the parent, which means that the encoded file UTF16LE was displayed as UTF8. Chrome and Firefox do not seem to do this.

Thanks to Xavier Holt for taking me on the right track!

+1
source share

All Articles