|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-30 18:43 UTC] lamsoft at gmail dot com
[2007-04-02 21:15 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ unlink, rename function cannot be executed if the filename is in unicode character, but opendir, readdir work fine. The following output is from the browser which the encoding is already set to UTF-8, it still some of the character cannot be read. The OS is English, but the regional settings has been set to Chinese (Taiwan), so that the PHP can only read characters those are in English Character or BIG5. <b>Warning</b>: unlink(h:\ndsrom\temp\unzipped/EZ [WWW.ABCDE.ORG] - [?��,��?��,ROM,??,��?,?�bEZ].url.url) [<a href='function.unlink'>function.unlink</a>]: Invalid argument in <b>D:\HTTP\Sub\nds\cli\php\checkUpdate_3.php</b> on line <b>157</b><br /> <br /> <b>Warning</b>: unlink(h:\ndsrom\temp\unzipped/�ϥ�?��.txt) [<a href='function.unlink'>function.unlink</a>]: Invalid argument in <b>D:\HTTP\Sub\nds\cli\php\checkUpdate_3.php</b> on line <b>157</b><br /> <br /> <b>Warning</b>: rename(h:\ndsrom\temp\unzipped/��?���?DS ��??�P��b�P��?��.nds,h:\ndsrom\temp\unzipped/test.zip) [<a href='function.rename'>function.rename</a>]: Invalid argument in <b>D:\HTTP\Sub\nds\cli\php\checkUpdate_3.php</b> on line <b>161</b><br /> Directory listing works fine, but it can't show the character~~ Array ( [0] => h:\ndsrom\temp\unzipped/EZ [WWW.EMU-ZONE.ORG] - [?��,��?��,ROM,??,��?,?�bEZ].url.url [1] => h:\ndsrom\temp\unzipped/�ϥ�?��.txt [2] => h:\ndsrom\temp\unzipped/��?���?DS ��??�P��b�P��?��.nds ) The file contains in that folder which browsed by Explorer: (An image, those filename are some Simplified Chinese name in UTF8 encoding) http://xs313.xs.to/xs313/07135/34tsdg.jpg Reproduce code: --------------- it is included in the description. In addition, the parameter in the rename and unlink is passed by the function of "directoryToArray" which is copied from "http://snippets.dzone.com/posts/show/155" and use foreach to unlink or rename the filename Expected result: ---------------- The file can be renamed and unlink successfully without any warnings. Actual result: -------------- it is included in the description.