.


web tutorials


Fixing garbled Firefox pages

We started to have problems with Firefox rather suddenly, with garbled pages, incomplete pages, images not showing up, and rubbish showing up in the middle. We went through the usual suspects - gzip compression was already shut off in Apache, for example - and were at a loss when we suddenly discovered an issue with character encodings reported by blogs. Apparently, setting character encoding, never before particularly important, was made essential by the genius coders at Firefox, who love to enforce pointless standards. (These are the same people who made us go nuts when they decided that GetElementById was the only way to do it.) I'm all for having a good alternative browser, but if they have the same attitude as Microsoft...what's the point?

Anyway, here's the fix, according to Gav:

  1. Make sure you have various character sets defined in Apache (in Apache 1.3, make sure AddCharset UTF-8 .utf8 is enabled - not commented out - doesn't have a # at the start of the line.)
  2. For most English-writing people, who can use the UTF8 character set - and probably most people using Roman languages - add the following line to the Apache configuration file, just below the AddCharset lines: AddDefaultCharset utf-8

That fixed the problem very quickly, with just a single Apache restart (apachectl restart or service httpd restart). It also made our site seem much faster!