Bug #47096 [Com]: move_uploaded_file not OS encoding aware

From: Date: Fri, 23 Sep 2011 03:02:09 +0000
Subject: Bug #47096 [Com]: move_uploaded_file not OS encoding aware
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163801@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47096&edit=1

 ID:                 47096
 Comment by:         xd-yang at qq dot com
 Reported by:        nuabaranda at web dot de
 Summary:            move_uploaded_file not OS encoding aware
 Status:             Open
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   win32 only - Windows XP
 PHP Version:        5.2.8
 Block user comment: N
 Private report:     N

 New Comment:

Since basename() is locale aware, why not move_uploaded_file()?
A common remedial measure is to use iconv() to explicitly convert the destination filename encoding
usually from utf-8 to ansi(like gb2312). But this becomes complicated and unreachable in a
multilingual CMS, like wordpress. Can this issue be solved in the future?


Previous Comments:
------------------------------------------------------------------------
[2009-02-26 09:46:51] mm107137 at spamcorptastic dot com

I have the same problem under debian host (ovh hoster).
Filename with french accents passed to move_upload_file are destroyed.
There's no problems if filename is not passed as utf8.

Very annoying

------------------------------------------------------------------------
[2009-02-06 20:21:49] mindfreakthemon at gmail dot com

And on Windows 7 and Vista under Apache 2.2 that bug exists too.

------------------------------------------------------------------------
[2009-01-14 09:26:41] nuabaranda at web dot de

Description:
------------
Files with filenames containing non-ascii characters like german umlauts get destroyed when saved
with move_uploaded_file(). The UTF-8 special characters get translated byte-wise into CP1251
characters when determining the Windows filenames thus destroying the original special characters.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=47096&edit=1


Thread (11 messages)

« previous php.bugs (#163801) next »