开发者

IE9 encoding problem

In one of my asp.net-applications I found a strange behaviour produced in Internet Explorer 9 while IE8 works well.

As the default encodi开发者_Go百科ng I need utf-8. That's important because I use german so called Umlaute like "ÄäÖüÜü".

When the page is loaded for the first time IE9 decides to use "Western Europe" Encoding. That's ISO 8859-1 as far as I know and the Umlaute change to strange letters. On the second load IE9 uses utf-8 correctly. In the sourcecode I tried the following things to tell IE which encoding to use:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de">
<meta http-equiv="content-type" content="text/html; charset=utf-8">

Why does IE9 work so strange on the first load? And what else can I try to tell IE9 how to work


Firstable - server where you host your site can return wrong encoding information in header;

Two - maybe it's some fail in string that tolk about encoding in the header of your page (wrong symbol in that string).

Three - open you page in Hex brouser (WinHex for example) and post first row of code (sometimes editor place wrong data in first byte, I've stumble on it once)

If this site is placed online, post it's url and I try to find a problem.


Check response header of you server it must contains something like this:

Key Value

Content-Type text/html; charset=utf-8

Response HTTP/1.1 200 OK

if it's not then check you server settings or you code there must be place where Content-type header changes

EDIT: ok, encoding is right, as suggested in the comment you shoul check first bytes of you response, it seems like it starts with additional bytes (usually info about encoding)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜