Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to upload files named by pure non-latin chars #7

Closed
billzt opened this issue Jun 15, 2016 · 9 comments
Closed

Failed to upload files named by pure non-latin chars #7

billzt opened this issue Jun 15, 2016 · 9 comments

Comments

@billzt
Copy link

billzt commented Jun 15, 2016

Using the lastest master version, upload files named by latin chars is totally OK. However upload files named by pure non-latin chars failed.

In configure file, "charsLatinOnly" has been set to "false"

When I upload a file called 测试文件.txt , it shows:

aa
20160615092018

When I upload a file called a测试文件.txt (begin with latin chars, end with non-latin chars), it is OK.
When I upload a file called 测试文件a.txt (begin with non-latin chars, end with latin chars), it is also OK, however non-latin chars would be deleted. Therefore the result name is only a.txt.

@simogeo
Copy link
Contributor

simogeo commented Jun 15, 2016

Using the lastest master version, upload files named by latin chars is totally OK. However upload files named by pure non-latin chars failed.

same problem here

@psolom
Copy link
Owner

psolom commented Jun 15, 2016

Try to set normalizeFilename to false
https://github.com/servocoder/RichFilemanager/wiki/Filemanager-configuration-file#the-security-section

If you has INTL extension installed it would transliterate chars, otherwise it cuts non-latin chars.

@billzt
Copy link
Author

billzt commented Jun 15, 2016

Well, first I confirm that php-intl has been installed (this is the output from <?php phpinfo(); ?>)
20160615205925

Second, I changed "normalizeFilename": false, in configure file.

However, the problem also occurs.

It should be noticed that the filename stored in the server directory (viewed from FTP) is OK, but the filename shown in the web Filemanager is wrong. Non-latin chars again has been cut.

@psolom
Copy link
Owner

psolom commented Jun 15, 2016

I see, going to research it soon

@psolom
Copy link
Owner

psolom commented Jun 16, 2016

Hey, I have reviewed my code and come to such thoghts:

  1. normalizeFilename should not affect your problem.
  2. The version of your ICU is quite old, it would be a good idea to update it, but this is not the cause of the error. Moreover it is applied while transliteration only, when charsLatinOnly is true.
  3. Take a look at Filename start with non-latin charaters would disappear after download simogeo/Filemanager#474 - this issue was opened by you. If that is the same case there is the solution I have provided for the problem via setlocale in the end of the discussion. Try it and let me know.

@psolom
Copy link
Owner

psolom commented Jun 16, 2016

So you have to add string setlocale(LC_ALL, 'en_US.UTF-8'); in the LocalFilemanager::__constructor() here. If you will manage with this, then I will think on the better way to apply it in the code.

@billzt
Copy link
Author

billzt commented Jun 16, 2016

Yes. After add setlocale(LC_ALL, 'en_US.UTF-8');, the bug is fixed. Thank you!

@billzt billzt closed this as completed Jun 16, 2016
psolom added a commit that referenced this issue Jun 20, 2016
@psolom
Copy link
Owner

psolom commented Jun 20, 2016

The fix has been included.

@ghost
Copy link

ghost commented Dec 20, 2016

In the latest version of this bug again.Cannot create the pure Chinese folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants