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

Setting Up Name-Based HTTPS Virtual Hosts (SNI) with Let’s Encrypt
Let's Encrypt is a free TLS server-certificate service provided by the US foundation Internet Security Research Group (ISRG). Its motto is free, automated, secure, transparent, open,…

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…

Localizing the WordPress Theme Minimal Xpert into Japanese
One WordPress theme I have recently come to like is Minimal Xpert. I had been using it for some time on the Cimbalom World Association website,…
