最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Problem with displaying french character in IE - Stack Overflow

programmeradmin7浏览0评论

I have to display "sélection?" in one of page that is viewed via iframe. But this is getting rendered as "s�lection?". If I view it requesting the page then it is rendering properly. But if I view it in an iframe it gets changed. Same thing is happening in Firefox and Chrome.

I have to display "sélection?" in one of page that is viewed via iframe. But this is getting rendered as "s�lection?". If I view it requesting the page then it is rendering properly. But if I view it in an iframe it gets changed. Same thing is happening in Firefox and Chrome.

Share Improve this question edited Mar 4, 2011 at 15:23 Konerak 39.8k12 gold badges101 silver badges121 bronze badges asked Mar 4, 2011 at 15:16 Niraj ChoubeyNiraj Choubey 4,04018 gold badges60 silver badges94 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 7

Just write sélection.

What's happening is that your browser is displaying the page in another encoding (eg ISO-8859-1 instead of UTF-8). There are multiple reasons why this can happen:

  1. The tag in your <head> says so.
  2. The tag in the webservers response headers says so.
  3. The browser is setup to override the formatting on the page.

If it works on the page itself, but when the page is in an iframe, check the encoding of the page containing the iframe. It will probably differ. Look for this kind of tag:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

And make sure they are the same on both pages (hint: you should probably be using UTF-8)

Do you have the right charset?

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

Along with the meta tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8">, I convert the document to UTF-8, you have all kind of software to convert it to you (dreamweaver, textedit, etc).

发布评论

评论列表(0)

  1. 暂无评论