php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34574 scandir() and readdir() do not support Unicode filenames
Submitted: 2005-09-21 10:14 UTC Modified: 2005-09-21 16:56 UTC
From: maxime dot pacary at winsoft dot fr Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.0.5 OS: Windows XP, 2003
Private report: No CVE-ID: None
 [2005-09-21 10:14 UTC] maxime dot pacary at winsoft dot fr
Description:
------------
Hello PHP team,


When I try to use scandir() and readdir() to get the content of a directory, if a file/dir name contains non iso-8859-1 characters, it is not retrieved correctly in PHP.

e.g. (real dir name => result in PHP)

test1 => test1
test2łćęśż => test2lcesz
test3我很高兴 => test3????


chdir() does not work as well when trying to change to a directory containing such characters (error: no such file or directory)


And when I just try to execute a PHP script in such a directory - I get the following errors :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Warning: Unknown: Failed opening 'D:\MAX\Source\test\test4我很高兴\index.php' for inclusion (include_path='.;C:\php5\pear') in Unknown on line 0


I have tried using GB2312 and UTF-8 Content-Type headers (suggested by moriyoshi), and checked the "real" content of the retrieved string, but there are (e.g. for chinese) only '?' characters (ASCII 63), nothing else "hidden" by something like a wrong charset.


Thank you for your attention,

Frosty


NB. I have already added this message as a comment for bug #30195, so if you want you can mark this bug as duplicate ; I have created a new bug, because when you add a comment to a bug already in 'No feedback' status, its status does not change so the bug remains 'buried' in the deep darkness of the bugs waiting for feedback...

It would be better if a bug status changes back to 'Open' or 'Feedback' when a comment is added...

Thank you,

Frosty


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-21 16:16 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

PHP does not support unicode operations until PHP6.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC