Scrambled foreign characters in MT

| 2 Comments

In my last entry, I mentioned a problem that I was having with high-ASCII characters appearing as garbled text after an upgrade to my university’s weblog server environment.

For example, ゴジラ or Cézanne would show up as ゴジラ or Cézanne, respectively.

I spent the first week of my holiday vacation with this problem hanging over my head. In a way, the ability to remotely access one’s work computer from home via VPN can be a bad thing because the temptation to try and resolve such a problem during “off-hours” is too great.

My attempt to completely put the problem out of my mind for at least the 24 hours of Christmas Day failed when the director of my department e-mailed me that very day, asking me for a status update on the problem.

Anyway, the former server admin finally e-mailed me the log-in information to obtain support from Six Apart, the company that makes Movable Type. Six Apart sent me two links that did not help and one wonderful link that finally solved my problem.

The solution was so simple, yet frustratingly difficult to find. It was the upgrade from Apache 1.3x to Apache 2 that did it. There is a bug (“feature”) in Apache 2, where Apache can override the character set encoding, even when it is defined by the charset attribute in an HTML page’s meta tags.

All I had to do to fix the problem was add the line AddDefaultCharset Off to my httpd configuration files and restart Apache.

I present all three links here in the hopes that if someone else runs into a similar problem, they are more likely to stumble across the solution via Google.

These are the links that did not help in my situation:
Accented Characters Display Incorrectly
Characters In My Language Are Encoded Incorrectly

This is the link that saved my butt (or at least my sanity):
Debugging charset encoding mismatch with Apache

2 Comments

I’m glad you found it useful, I posted it precisely so that others would not waste as much time as I did to fix this Apache 2 “feature”.

I do want to thank you, François. I spent far too many hours over the Christmas holiday doing trial-and-error troubleshooting while trying to track down this problem.

If Six Apart hadn’t sent me that link to your site, I bet that I would still be trying to figure out the problem.