Jump to content

[Resolved] Digital Downloads with Japanese file & directory names not displaying


Jackrabbitass

Recommended Posts

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?

Screen Shot 2016-12-02 at 18.15.03.jpg

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...