Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I try to upload file "Текстовый документ.txt" but I got " документ.txt" uploaded (with space as 1st symbol).
Upload module cuts 1st word of Cyrillic filenames (Russian filenames).
I can fix it by changing line 43 of unicode.inc
Originally:
// Set the standard C locale to ensure consistent, ASCII-only string handling.
setlocale(LC_CTYPE, 'C');
Fix:
setlocale(LC_CTYPE, 'ru_RU.UTF-8');
But must be way to fix it without core patch.
If it hard to automatize this, may be we can add "locale" option into "general settings" of upload module?
May be it is core bug which is shown in upload module...
PHP Version 5.2.10
System Linux 2.6.18
Server Apache 2.0
Drupal version 6.15
Drupal path (not depends)
Comments
Comment #1
Ivan Simonov CreditAttribution: Ivan Simonov commentedduplicate of #278425: Using basename() is not locale safe
Comment #2
vicktech CreditAttribution: vicktech commentedCyrillic names are mangled severely when uploaded by upload module.
"File not found" error message appears at attempt to download uploaded cyrillic named file.
Although when changed back to proper cyrillic name manually in the files upload folder - then downloaded without prombelm.
So system can maintain downloading file to the user, but suffers at upload process.
This is a BUG!!!
Doesn't DRUPAL support unicode or utf8 of some universal encoding or at least encoding recognition?
Transliterate module is NOT solution.
We need to keep information trhough upload/download process SAFELY, without mangling file names.
Even if chinese and russian files are uploading at the same time.
Please explain us where exactly in DRUPAL the BUGGY place is. Or may be there is some hidden technical limitations?
Comment #3
andypostThis is a php bug. For more info follow #278425: Using basename() is not locale safe
Comment #4
Ivan Simonov CreditAttribution: Ivan Simonov commentedhttp://drupal.org/project/cyrillic_fix