Tuesday, February 17, 2009

Unexpected display of non-readable characters in a page

An unexpected display of non-readable characters in a page for characters like the quote mark seems at best sporadic. However, this behavior is normal for IE, Firefox and other browsers. This is caused by the change is the page encoding. One possibility is an inconsistency in the Meta tag between pages. By default, my browser is set to encoding > auto-select > Unicode (UTF-8). However, because the encoding > auto-select is checked, the browser will render the page using the encoding as determined by the character set or Meta tag specified in the page [i.e.: Meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1].

For example, if one page rendered in a browser session has a different encoding from the next rendered page’s character set, IE should (but not always) use the new encoding setting as determined by the Meta tag or page character set. For whatever reason, if IE cannot determine the character set, it could use an inappropriate setting. You can try to prevent this situation by checking the Internet Option > Advanced > Browsing > ‘Always send URLS as UTF-8’ setting which forces the browser to attempt to set the encoding to UTF-8 for the page. This does not help if the encoding is specifically overridden in the page.

For more information which applies to IE6 and IE7, take a look at the following KB article: support.microsoft.com/.../928847 .


I hope this helps.

Roy

No comments: