Jackrabbitass Posted December 2, 2016 Share Posted December 2, 2016 I sell Japanese study audio downloads. Director names and file names use Japanese characters like "動物.mp3" (for "animals.mp3") because my customers are Japanese. However, these files are not displaying in "Download Filemanager" page. If I rename the file to English it displays. Otherwise nothing displays at all. Also, Japanese directory names do not display in Filemanager either. Instead, they directory name displays like this "________" . Is there any way to make directories and files display in Japanese? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2016 Share Posted December 2, 2016 Please try this. (I will experiment, myself, later.) In /classes/filemanager.class.php, near line 534 -- in the function formatName(): Find: return preg_replace('#[^\w\.\-\_]#i', '_', $name); Change to: return preg_replace('#[^\w\.\-\_]#iu', '_', $name); If that doesn't work, try (just a wild guess if this will work): return preg_replace('#[^\p{L}\w\.\-\_]#iu', '_', $name); Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 2, 2016 Share Posted December 2, 2016 Just now tried the first edit. Seems to work. Probably this development workstation (WinXP-SP3) isn't setup for UTF-8 file system as what I get when I create a folder using those foreign characters above (animals), I actually see 動物. But CubeCart shows it correctly. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted December 5, 2016 Share Posted December 5, 2016 That doesn't work for me. Creating a folder called 動物 returns __ Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted December 6, 2016 Share Posted December 6, 2016 So to my understanding it boils down to sever config as to what the regex character class "\w" matches. Some servers will only allow [a-zA-Z_0-9] whilst others allow "foreign" characters. A bit more info here... http://php.net/manual/en/regexp.reference.character-classes.php I have more digging to do yet. From my testing on Max OSX the following works well. Thanks Brian. #[^\p{L}\w\.\-\_]#iu Quote Link to comment Share on other sites More sharing options...
Jackrabbitass Posted January 2, 2017 Author Share Posted January 2, 2017 Problem solved. Thanks very much. I did your 1st suggestion and filenames are properly displaying in "Download Filemanager" page now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.