Special (Non-English) characters in filenames

The cause
Recently, a small number of our users have noticed and notified us that some of their files started to have special characters in their filenames. We did an investigation and a bit of researching until we figured out what the cause is and how to address it.

The only users affected by this problem are using Windows on their server. There is a 7-year-old bug entry in PHP that describes the problem: https://bugs.php.net/bug.php?id=47096
Basically, PHP will use the locale set in Regional Settings of the Windows Operating System. The default setting of the locale is English, which means that PHP will support only ascii characters on the filesystem.

The solutions
1. So now that we have identified the problem is, we can address it. We love our users and we do our best to automate every process for them. This, however, turns out to be one of those things that we could not solve and have to ask you, our users, to take some additional steps to solve it.
If you are administering the machine yourself, navigate to Control Panel, then location Regional Settings and update the language to the locale that you are using.
If your website is in German, make sure to set the locale to German. This will add support for umlaute.
If your website is in Japanese, set the locale to Japanese.
When you are not the administrator or you have issues configuring the locale yourself, take advantage of the support that your hosting provider gives you.

2. If you are trying to export/import a WordPress that has files/directories with Non-English names, you should consider using PHP7, because it natively supports Unicode. Using PHP7 you will be able to run All-in-One WP Migration export/import of files/directories that have any characters in the file name.

3. If you are still using PHP 5.x and you have files/directories with Non-English characters, these files/directories will not be migrated properly during export/import. The workaround for now is to copy them manually via FTP/SFTP. This is limitation of PHP 5.x and the only way to avoid it is to switch to PHP7 and run the export/import again.

Leave A Comment?