views:

31

answers:

1

All the solutions for this issue say to use <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />, which works because it forces the browser to render in compatibility view (i.e. as if it were IE7), but then the characters don't display when the user is actually using IE7 (or a number of other browsers). Instead, I see squares.

Anyone else encounter this? How did you deal with it?

+1  A: 

This sounds like an encoding problem to me. Chinese characters are probably being output using UTF-8 encoding, but the browser is not being told that and is defaulting to another encoding.

Try including this line:

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

That should force the browser into UTF-8 encoding. (This line is included in the site linked in the referenced question: http://www.canadainternational.gc.ca/china-chine/index.aspx?lang=eng, which works fine in my IE8 and defaults to UTF-8.)

Note that the original question states that this is actually a separate issue entirely, involving IE8 relying on installed Windows language packs, while IE7 and earlier did not.


Alternatively as a quick-hack fix, you can just use IE conditionals to only present the meta tag to IE8 browsers.

<!--[if IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->

IE7 should ignore this line, causing it to render normally.

jdmichal
Very helpful information, but neither changing to UTF-8 encoding nor using the conditional hack helped. (I don't know why... that seemed like a sure fix!)
Leslie
Are you sure it displays fine in IE7 without the meta tag? Because unless IE is really acting funky, that conditional comment should keep that meta tag from being processed in anything but IE8. You can add an additional HTML display element to ensure that it is not being parsed in other browsers (including IE7) to test.
jdmichal