Closed (won't fix)
Project:
Drupal core
Version:
6.x-dev
Component:
upload.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2007 at 14:10 UTC
Updated:
27 Sep 2007 at 02:46 UTC
There is a bug that prevent using filenames with multibyte characters in upload.module. For example, attaching file with russian filename with spaces, result in lost of first word. Also, it's not possible to download such files in some browsers because of national characters in url.
Quick look to module source reveal that all string functions are not unicode aware (however, there are drupal wrappers existing for some of them, like drupal_strlen, drupal_strtoupper and drupal_strtolower). I think, this is odd for core module.
I think, the solution may be replacing all string functions with their unicode equivalents and using urlencode() to encode urls with national characters.
Comments
Comment #1
vitamin-1 commentedI found that loosing first word is because of PHP basename function in file.inc, line 224 (file_check_upload function), which doesn't work correctly with UTF-8 when LC_CTYPE is set to 'C'. Changing LC_CTYPE from 'C' to national locale ('ru_RU.UTF-8' in my case) in unicode.inc solve this particular basename problem, but I'm not sure about side effects that can arise.
Comment #2
drummWhat version of PHP are you using?
Comment #3
chx commentedcan't fix in lack of more information.
Comment #4
coldfly commentedi think there are some infomation
http://drupal.org/node/100766