Fix: display issue affecting IE7 and autoselect

I received the following email from a reader:

"I had an interesting email a few days ago from an IE7 user.  He visited www.tigardchurch.org to find most of the text on the Home Page surrounded by “b’s”.  I don’t own the site however; my wife is involved with keeping it current.  I tested everything from: IE6, Mozilla Firefox to Adobe Safari and it all looked fine.  I have held off loading IE7 for 1 yr after release and advised my clients to do so as well.  Have you encountered this issue before?"

First of all, I argue strongly against recommending that people stay away from IE7 for "1 yr after release" unless there is a definite reason for deferring installation - that is, there is a line of business application that breaks, or an important Web site affected that you *must* be able to access, and even then I would consider it wiser to install an alternative Browser so that you can view the affected site rather than run the risk of continued exposure to the security exploits that affect IE6 and earlier and do NOT affect IE7.  Of course, if a line of business application breaks, then that is something that may force you to defer installing IE7 until the application's vendor resolves the issue.

IE7 includes security updates and improvements that are simply too important to forgo without a good reason - IE7 has been immune to virtually every exploit that has affected IE6.  Then there is the Phishing Filter, and Extended Validation Certificate support, and the Add-on Manager.  Please don't hold off installing "just in case" or impose a stay-away timeframe.

Now, on to the Web site issues. I have been able to reproduce display problems for the site simply by toggling "Autoselect" under IE7's encoding options (tap the alt key on your keyboard if the Menu Bar is not enabled, then select View, then Encoding. You can turn off Autoselect there. 

When I turn on Autoselect the page immediate refreshs and exhibits problems.  When I turn off Autoselect and force a refresh of the page, the problem goes away.  Examples below:

Without autoselect:

With autoselect:

Without autoselect:

With autoselect:

Unfortunately I simply don't know enough about Web page design and coding to be able to tell you how to fix this.  Quick and dirty fix is to advise visitors NOT to enable the Autoselect encoding option, but the site's owners should also have a chat to somebody wiser than me about how to fix the issue, and whether the issue is with IE7 or the site itself.

 

Published Tue, Jul 17 2007 9:32 by sandi

Comments

# re: Fix: display issue affecting IE7 and autoselect

Tuesday, July 17, 2007 2:42 AM by Nicholas

It's not a bug. Firefox does it too in some cases. It's because of using "Word" style quotes, without properly escaping the HTML:

www.dwheeler.com/.../quotes-in-html.html

The webmaster should run their pages through an HTML validator, or use the excellent Web Developer add-on plus the "HTML Validator" add-on for FireFox to do the job lickety split.

# re: Fix: display issue affecting IE7 and autoselect

Tuesday, July 17, 2007 4:26 AM by Rob Nicholls

IE7 on Vista, 2003 and XP doesn't appear to have Auto-Select enabled by default. I had to turn it on to see the problem.

The web site sends the following HTTP header:

Content-Type: text/html; charset=UTF-8

But their index page contains the following meta tag:

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

These should be consistent. In this case, they're not, but it appears that the rest of the pages on their site have a meta tag that says utf-8. I suspect the easiest fix is to edit the meta tag on the index page to say utf-8 instead of iso-8859-1.

I think the issue they've noticed is similar to this one, which applies to IE6 and IE7: support.microsoft.com/.../928847

When Microsoft Internet Explorer renders an HTML page, it may use the wrong character set. Internet Explorer may do this even though the correct character set is specified by a META tag in the HTML page.

I think this means that with Auto-Select enabled it uses the meta tag and displays the page with the iso-8859-1 character set (either that or it guesses based on the content of the page), but when Auto-Select is disabled it uses the utf-8 character set as defined in the HTTP header, which is why everything looks fine. I haven't done any proper testing, as it's not usually sensible to state two conflicting character sets for a page.

Auto-Select is a bad thing, IMHO, and this is probably why it doesn't appear to be enabled anywhere by default, and why I don't use it myself.

Character encoding is a tricky thing, and IE hasn't got a great track record, but it should be possible to make everything behave.

# re: Fix: display issue affecting IE7 and autoselect

Tuesday, July 17, 2007 6:46 PM by sandi

@ Rob and Nicholas,

See! I knew I had clever readers :o)