|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63593 scandir return "?" in place of unicode letter in Windows httpd.
Submitted: 2012-11-23 23:06 UTC Modified: 2012-11-24 13:05 UTC
From: john dot peterson10 at gmail dot com Assigned:
Status: Duplicate Package: *Unicode Issues
PHP Version: 5.5Git-2012-11-23 (snap) OS: Windows
Private report: No CVE-ID: None
 [2012-11-23 23:06 UTC] john dot peterson10 at gmail dot com


httpd-2.2.22-win32-x86-openssl-0.9.8t.msi/program files/Apache Software 

# cd `httpd ServerRoot`
touch ファイル
curl -v 'http://server/test.php'	# return "????"
php test.php						# return "ファイル"

Test script:
<?php header("content-type: text/plain; charset=utf-8"); print_r(scandir(".")); ?>

Expected result:
See above.

Actual result:
See above.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-24 11:56 UTC]
-Status: Open +Status: Duplicate
 [2012-11-24 11:56 UTC]
there is no Unicode support for file system functions in PHP. There is already a 
feature request for that > mark as duplicated.
 [2012-11-24 11:59 UTC] john dot peterson10 at gmail dot com
What is the duplicate ID?
 [2012-11-24 12:20 UTC]
I don't have it at hand but if you search for 'windows file unicode', you will 
find a couple with work around (tricky but possible).
 [2012-11-24 12:34 UTC] john dot peterson10 at gmail dot com
Please comment on the fact that CLI and httpd return different data.

Please post the relevant source file and line.
 [2012-11-24 12:42 UTC] john dot peterson10 at gmail dot com
php test.php				# return "????"
%cygwin%/bin/php test.php		# return "ファイル"
 [2012-11-24 12:56 UTC]
Different runtime encoding. Nothing wrong here. Also cygwin is total different 
story from a shell point of view.
 [2012-11-24 12:58 UTC] john dot peterson10 at gmail dot com
"Please post the relevant source file and line."
 [2012-11-24 13:05 UTC]
No, sorry. I do not have the time to give all the details again. Look at the other 
bugs, explanation are in there. You have to convert your filenames to the runtime 
encoding, given that you know it.

Changing the core to support wild char APIs are not yet planed for 5.5.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 21:03:13 2021 UTC