I want to save some data in files with file names which would have unicode characters in it (like chinese, cyrillic, arabic, ...) with PHP's file_put_contents() functions. I don't want to encode them separately with something like urlencode() because no human would be able to read the file names if they contained only non-latin chars. The 3 biggest OSes Windows, MacOS / OS X and Linux support UTF-8 or UTF-16 chars in file names and can display them without problems but it seems that it's not that easy as just calling something like that:
file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . "こんにちは.txt", "");
On Windows 7 (German localization) the file is stored as:
ã“ã‚“ã«ã¡ã¯.txt
The PHP file itself is saved in UTF-8 encoding. Is there an uniform way to save files with unicode in the file name on this 3 systems?