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

Ivan Simonov’s picture

Status: Active » Closed (duplicate)
vicktech’s picture

Version: 6.15 » 6.14
Assigned: Unassigned » vicktech
Category: bug » feature
Priority: Normal » Critical
Status: Closed (duplicate) » Active

Cyrillic 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?

andypost’s picture

Version: 6.14 » 6.x-dev
Status: Active » Closed (duplicate)

This is a php bug. For more info follow #278425: Using basename() is not locale safe

Ivan Simonov’s picture