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 badges3 Answers
Reset to default 7Just 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:
- The tag in your
<head>
says so. - The tag in the webservers response headers says so.
- 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).