I got a little stuck on this…
Have you ever migrated an old EUC-JP or Shift JIS site to a new server and ended up with garbled characters? I have. In fact, that happened to me this morning.
At first I thought, “Sure, DefaultCharSet,” and quickly edited the files under /etc/apache2/sites-available/, but the change was not applied! Even when I checked with Chrome Developer Tools, it was still being sent as UTF-8.
“Why???”
I spent quite a while puzzling over it.
The actual reason was that the site used PHP. PHP overrides Apache settings and the like with the charset specified in php.ini. So, adding the following to the configuration file for the relevant Apache virtual host gives PHP an instruction and resolves the issue.
php_value default_charset EUC-JP
That makes sense. So that I do not get stuck on this again, I am leaving this here as a note.
Related posts

Installing an SSL Certificate with Let’s Encrypt, Now Certbot
This article is outdated. Most Linux distributions should now support Certbot packages, so please use those.If custom configuration is needed, it will probably concern how to…

If You’re Making a Presentation, gamma.app May Be the Way to Go
Yesterday, information saying, “If you’re making a presentation, use gamma.app,” reached me from 2 independent directions. So I started by trying the free version. To give…

Migrating WordPress Brought Up the Dreaded Installation Screen
Yes, I ran into this this morning as well. With MyISAM, you only need to move the database files, but because InnoDB was involved this time,…
