Wednesday, October 13, 2010

Web Page Shows Its Code to Chrome, Not Firefox


A colleague recently shared this perplexing situation that led to viewing a web page like the one shown above:
An instructor in my department is having a problem with Chrome and would like some help on how to solve the problem. Following is the message that she sent to me. Thank you in advance for any feedback that I might pass along to her.

A website is viewed perfectly in IE or firefox. However, when viewed using Google Chrome the website just displays the HTML code. I tried using Wc3 valuators to validate the code. However, I am still not 100% certain why this is occurring? Any ideas, suggestions, etc.?????? HELP!

Website with the problem: http://www.electrasave.com/

Although a bit late last night, I decided to check it out. The site appeared fine in Firefox on UbuntuLinux, but on Chrome (again running on UbuntuLinux), the site appeared as code. What a fascinating problem! Here's what the page should look like in Chrome (and appears just fine in Firefox):



I'm not sure why it occurred to me to check the encoding, just a flash of insight.
Some quick investigation revealed that the page will display properly on Chrome. Firefox detected that the page was encoded as Unicode UTF-16LE. Chrome doesn't.

To get Chrome to recognize it as such, you have to change the encoding by going to the little wrench, clicking on it, go to TOOLS and under ENCODING, choose UTF-16LE. This is a temporary solution, though, because if you leave the site, Chrome defaults back to whatever is the default.

To make the change permanently, go to your Chrome Options, and Look in "UNDER THE HOOD."

Scroll down until you see WEB CONTENT section, click on Change Font and Language Settings, and change the default encoding to UTF-16LE. This will ensure the site linked in your email works without problem.


Making the change didn't seem to adversely affect visiting other web sites...they showed up just fine, as did the page in question. Kinda geeky, huh? Again, what a fun problem to solve at day's end.




Delicious Bookmark this on Delicious
Subscribe to Around the Corner-MGuhlin.org


Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

2 comments:

Chris Craft said...

Hi Miguel,

That's a find workaround.

The problem lies with the MIME definitions on the server end. They are likely set to the incorrect character set. You have effectively forced the browser to override that MIME type.

Given that the site is hosted by Godaddy, it should be an easy fix.

Chris Craft

Amit said...

Hi..
I am Amit. I have also same problem for www.dcg.net.in website. This website opens in only IE not any other browsers & even IE9. I have tried as you told for above site but it didn't work for me.
Actually i am working over their and i have that task to make website compatible to all browsers.
So please help me how i can change in code so website will be runs on all browsers.
thanks in advance
email id : amit9_s@yahoo.com
amit9.rocks@gmail.com

Genuine Leadership #4: Gratitude