How to Display East Asian Fonts (i.e. Japanese) with WordExpress

I had been using Japanese text on and off for quite a while but I realized after I upgraded that my old posts had the old Japanese text changed from 日本語 to ?????? (2019-06-19 update: it happened again). It was a permanent change, too, and all my previous Japanese text was lost to the mystery of entropy. I wasn’t happy with it, but what can I do other than rub my hands and quietly plot revenge? I did find the problem and have fixed it though, and I’m posting the fix so nobody has to go through what I did (the changes recommended through searches were generally outdated, dead-ends or involved and complicated, so I’m posting the simple one).

Somewhere in there a change in the standard WordExpress configuration file defaults set things to UTF-8, which somehow kills whatever used to be in the database. The offending bit of code can be found in the ~/foo/public_html/wp-config.php file. Here is where to find it if you have WebExpress at the front of your file tree:

wp-config.png

Once you locate it, open it for editing and comment out the two lines that read:

define(‘DB_CHARSET’, ‘UTF-8’);
define(‘DB_COLLATE’, ”);

like so:

offendingcode.png

I recommend commenting things out instead of deleting because its a habit formed out of long experience with screwing up configuration files and not saving an original to refer to later… (In php and other C-based languages this means putting the “//” in front of them so they get ignored.) Once you comment out (or (>.<) delete!) the two lines you see above, everything should work fine.

これからは大丈夫かわからないな〜・・・

So, happy blogging!
…internet nerds…

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.