Why is Internet Explorer 9 showing weird characters in UTF8 and whitespace content?

I am currently working on a client site and stumbled upon this strange error considering HTML:

<p>&nbsp;</p> <p> <span class="indentLeft"> REDACTED&nbsp;A/S&nbsp;har hovedsæde i Århus (foto). </span> </p> 

Internet Explorer 9 displays the following:

IE9 Snippet showing whitespace characters

Now, for starters, I thought it was a coding problem, with the exception of IE7, IE8, firefox, chrome and safari, it shows this correctly.

So my question is actually ... is there something new in Internet Explorer 9 that I don’t know about, some kind of header that displays HTML objects, or is it my server side encoding?

I tried forcibly changing encodings in IE9 with no luck to get back to square.

+6
source share
5 answers

What is the character encoding used by the file that stores the HTML? Define the encoding, and then set this encoding for use by any analysis document. For example, if your document is stored in UTF-8 encoding:

 <head> <meta charset="UTF-8"> </head> 

I will also try changing the font, just to make sure this is not a glyph problem, but I also suspect coding.

+12
source

I have a similar problem in IE9, where utf-8 passed xmlHTTPRequest is interpreted as ISO 8859-1, despite the fact that the implementation document has:

 <meta http-equiv="content-type" content="text/html;charset=utf-8"> 

.. and that XMLHttpRequest.getResponseHeader('Content-Type') returns: text/html; charset=UTF-8 text/html; charset=UTF-8

Switching to a font without TTF does not help

This happens if the implementing document contains:

 <meta http-equiv="X-UA-Compatible" content="IE=8"> 

The problem disappears if the line is deleted or changed to:

 <meta http-equiv="X-UA-Compatible" content="IE=7"> 
+3
source

I solved the problem by opening the file (theme-ui.php) in visual studio and saving it as "unicode without signature".

+3
source

I had the same problem, unsuccessfully tried the solutions of Nathan and Terje.

I finally solved the problem by changing the encoding in Notepad ++ from "Encoding to UTF-8 without specification" to "Encoding to UTF-8"

Hope this helps.

+2
source

In my case, the problem was about the font! The Arabic font used by me was incompatible with IE, but worked well with chrome. I changed the font to compatible!

0
source

Source: https://habr.com/ru/post/887265/


All Articles