Bug #30195 [Com]: scandir etc cannot read Chinese file/folder name
Edit report at https://bugs.php.net/bug.php?id=30195&edit=1 ID: 30195 Comment by: martin dot keckeis1 at gmail dot com Reported by:percy at savant dot us Summary:scandir etc cannot read Chinese file/folder name Status: No Feedback Type: Bug Package:*Directory/Filesystem functions Operating System: windows xp/2003 PHP Version:5CVS-2004-09-22 (dev) Block user comment: N Private report: N New Comment: Its a problem in PHP general. This could have been solved with PHP 6.0 (general multibyte support). There are some workarounds in the internet with the windows console. Previous Comments: [2011-06-07 00:08:23] spidgorny at gmail dot com Same problem (files with question marks) with Russian files in PHP 5.3.0 on Windows 7. mb_convert_encoding() can't help converting question marks. Maybe DirectoryIterator will help. [2010-08-29 18:13:24] onekamil at gmail dot com Hi, have the same problem and my solution is: using mb_convert_encoding. $open = opendir($path); foreach( $open as $value ) { $value = mb_convert_encoding($value, mb_detect_order($value), "UTF-8"); } If saving file to folder using urlencode. To view using urldecode. [2007-03-31 23:30:05] missingno at ifrance dot com Same problem here. On WinXP with PHP 5.2.0, using iso-8859-1 as charset for the system (though the filesystem uses utf-8 for folders/files names). I need to access folders whose names are encoded using UTF-8. readdir/scandir won't allow me to do so (returning '?' for characters outside the system charset). The page is served like this: header('Content-Type: text/html; charset=utf-8'); So the browser really isn't at fault. Serving the document with a more specific charset is not an option since I have to display texts in many different languages on the page. As moleary at preg dot org suggested, it would be really nice to have an option to force PHP to use a certain encoding while accessing the filesystem. Or maybe, make it so that it uses the same encoding as the filesystem instead of defaulting to iso-8859-1... [2006-07-10 10:02:31] gandhavallakiran at yahoo dot co dot in hi i have used the babel class in my coding of php. but it could not read the characters of china and japan i.e. special characters. it is displaying the blank space instead of china or japan text. could you help me in this reacord how to display china characters in php. please it is very urgent kindly help me. [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=30195 -- Edit this bug report at https://bugs.php.net/bug.php?id=30195&edit=1
Bug #30195 [Com]: scandir etc cannot read Chinese file/folder name
Edit report at http://bugs.php.net/bug.php?id=30195&edit=1 ID: 30195 Comment by: spidgorny at gmail dot com Reported by:percy at savant dot us Summary:scandir etc cannot read Chinese file/folder name Status: No Feedback Type: Bug Package:*Directory/Filesystem functions Operating System: windows xp/2003 PHP Version:5CVS-2004-09-22 (dev) Block user comment: N Private report: N New Comment: Same problem (files with question marks) with Russian files in PHP 5.3.0 on Windows 7. mb_convert_encoding() can't help converting question marks. Maybe DirectoryIterator will help. Previous Comments: [2010-08-29 18:13:24] onekamil at gmail dot com Hi, have the same problem and my solution is: using mb_convert_encoding. $open = opendir($path); foreach( $open as $value ) { $value = mb_convert_encoding($value, mb_detect_order($value), "UTF-8"); } If saving file to folder using urlencode. To view using urldecode. [2007-03-31 23:30:05] missingno at ifrance dot com Same problem here. On WinXP with PHP 5.2.0, using iso-8859-1 as charset for the system (though the filesystem uses utf-8 for folders/files names). I need to access folders whose names are encoded using UTF-8. readdir/scandir won't allow me to do so (returning '?' for characters outside the system charset). The page is served like this: header('Content-Type: text/html; charset=utf-8'); So the browser really isn't at fault. Serving the document with a more specific charset is not an option since I have to display texts in many different languages on the page. As moleary at preg dot org suggested, it would be really nice to have an option to force PHP to use a certain encoding while accessing the filesystem. Or maybe, make it so that it uses the same encoding as the filesystem instead of defaulting to iso-8859-1... [2006-07-10 10:02:31] gandhavallakiran at yahoo dot co dot in hi i have used the babel class in my coding of php. but it could not read the characters of china and japan i.e. special characters. it is displaying the blank space instead of china or japan text. could you help me in this reacord how to display china characters in php. please it is very urgent kindly help me. [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] moriyo...@php.net Note that all of these are PHP code, so paste it within . The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=30195 -- Edit this bug report at http://bugs.php.net/bug.php?id=30195&edit=1
Bug #30195 [Com]: scandir etc cannot read Chinese file/folder name
Edit report at http://bugs.php.net/bug.php?id=30195&edit=1 ID: 30195 Comment by: onekamil at gmail dot com Reported by:percy at savant dot us Summary:scandir etc cannot read Chinese file/folder name Status: No Feedback Type: Bug Package:*Directory/Filesystem functions Operating System: windows xp/2003 PHP Version:5CVS-2004-09-22 (dev) Block user comment: N New Comment: Hi, have the same problem and my solution is: using mb_convert_encoding. $open = opendir($path); foreach( $open as $value ) { $value = mb_convert_encoding($value, mb_detect_order($value), "UTF-8"); } If saving file to folder using urlencode. To view using urldecode. Previous Comments: [2007-03-31 23:30:05] missingno at ifrance dot com Same problem here. On WinXP with PHP 5.2.0, using iso-8859-1 as charset for the system (though the filesystem uses utf-8 for folders/files names). I need to access folders whose names are encoded using UTF-8. readdir/scandir won't allow me to do so (returning '?' for characters outside the system charset). The page is served like this: header('Content-Type: text/html; charset=utf-8'); So the browser really isn't at fault. Serving the document with a more specific charset is not an option since I have to display texts in many different languages on the page. As moleary at preg dot org suggested, it would be really nice to have an option to force PHP to use a certain encoding while accessing the filesystem. Or maybe, make it so that it uses the same encoding as the filesystem instead of defaulting to iso-8859-1... [2006-07-10 10:02:31] gandhavallakiran at yahoo dot co dot in hi i have used the babel class in my coding of php. but it could not read the characters of china and japan i.e. special characters. it is displaying the blank space instead of china or japan text. could you help me in this reacord how to display china characters in php. please it is very urgent kindly help me. [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] moriyo...@php.net Note that all of these are PHP code, so paste it within . [2005-02-17 15:20:57] moriyo...@php.net You might have shown strings of a native encoding as UTF-8 in your browser, most likely because of wrong Content-Type. Try putting one of the following at the top of your script and let's see what'll happen: CP936 (Simplified Chinese): header('Content-Type', 'text/html; charset=GB2312'); CP949 (Korean): header('Content-Type', 'text/html; charset=EUC-KR'); CP950 (Traditional Chinese): header('Content-Type', 'text/html; charset=BIG5'); CP932 (Japanese): header('Content-Type', 'text/html; charset=Shift_JIS'); The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=30195 -- Edit this bug report at http://bugs.php.net/bug.php?id=30195&edit=1
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: missingno at ifrance dot com Reported By: percy at savant dot us Status: No Feedback Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: Same problem here. On WinXP with PHP 5.2.0, using iso-8859-1 as charset for the system (though the filesystem uses utf-8 for folders/files names). I need to access folders whose names are encoded using UTF-8. readdir/scandir won't allow me to do so (returning '?' for characters outside the system charset). The page is served like this: header('Content-Type: text/html; charset=utf-8'); So the browser really isn't at fault. Serving the document with a more specific charset is not an option since I have to display texts in many different languages on the page. As moleary at preg dot org suggested, it would be really nice to have an option to force PHP to use a certain encoding while accessing the filesystem. Or maybe, make it so that it uses the same encoding as the filesystem instead of defaulting to iso-8859-1... Previous Comments: [2006-07-10 10:02:31] gandhavallakiran at yahoo dot co dot in hi i have used the babel class in my coding of php. but it could not read the characters of china and japan i.e. special characters. it is displaying the blank space instead of china or japan text. could you help me in this reacord how to display china characters in php. please it is very urgent kindly help me. [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] [EMAIL PROTECTED] Note that all of these are PHP code, so paste it within . [2005-02-17 15:20:57] [EMAIL PROTECTED] You might have shown strings of a native encoding as UTF-8 in your browser, most likely because of wrong Content-Type. Try putting one of the following at the top of your script and let's see what'll happen: CP936 (Simplified Chinese): header('Content-Type', 'text/html; charset=GB2312'); CP949 (Korean): header('Content-Type', 'text/html; charset=EUC-KR'); CP950 (Traditional Chinese): header('Content-Type', 'text/html; charset=BIG5'); CP932 (Japanese): header('Content-Type', 'text/html; charset=Shift_JIS'); [2005-01-28 18:02:07] moleary at preg dot org This is also the case for Japanese characters on the Windows platform. A note in the PHP manual says that opendir() uses ISO 8859-1 by default on WIndows installations. REPRO: 1) Install East Asian language supprto to XP through the Regioanl languages control panel 2) add a file with Japanese characters as the name (I copied a couple strings from the asahi.com web site) ACTUAL: 1) These same characters as text will be presented properly with the proper code page and/or header encoding. 2) The characters are not correctly parsed when looping through the contents of an opendir() on the directory in which you placed the file you created under the repro steps. EXPECTED: Ability to define charset for opendir(), or at very least use a more standard UTF-8 instead of ISO 8859-1 so that Asian named files can have their proper names returned by opendir() The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30195 -- Edit this bug report at http://bugs.php.net/?id=30195&edit=1
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: gandhavallakiran at yahoo dot co dot in Reported By: percy at savant dot us Status: No Feedback Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: hi i have used the babel class in my coding of php. but it could not read the characters of china and japan i.e. special characters. it is displaying the blank space instead of china or japan text. could you help me in this reacord how to display china characters in php. please it is very urgent kindly help me. Previous Comments: [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] [EMAIL PROTECTED] Note that all of these are PHP code, so paste it within . [2005-02-17 15:20:57] [EMAIL PROTECTED] You might have shown strings of a native encoding as UTF-8 in your browser, most likely because of wrong Content-Type. Try putting one of the following at the top of your script and let's see what'll happen: CP936 (Simplified Chinese): header('Content-Type', 'text/html; charset=GB2312'); CP949 (Korean): header('Content-Type', 'text/html; charset=EUC-KR'); CP950 (Traditional Chinese): header('Content-Type', 'text/html; charset=BIG5'); CP932 (Japanese): header('Content-Type', 'text/html; charset=Shift_JIS'); [2005-01-28 18:02:07] moleary at preg dot org This is also the case for Japanese characters on the Windows platform. A note in the PHP manual says that opendir() uses ISO 8859-1 by default on WIndows installations. REPRO: 1) Install East Asian language supprto to XP through the Regioanl languages control panel 2) add a file with Japanese characters as the name (I copied a couple strings from the asahi.com web site) ACTUAL: 1) These same characters as text will be presented properly with the proper code page and/or header encoding. 2) The characters are not correctly parsed when looping through the contents of an opendir() on the directory in which you placed the file you created under the repro steps. EXPECTED: Ability to define charset for opendir(), or at very least use a more standard UTF-8 instead of ISO 8859-1 so that Asian named files can have their proper names returned by opendir() [2004-12-27 15:39:53] dev at glossword dot info There is the same problem with php 5.0.2. How to reproduce: 1. Create file wøاアいנ.txt (urlencoded string is w%d1%88%d8%a7%e3%82%a2%e3%81%84%d7%a0.txt) 2. Read directory, readdir(). 3. You'll get wø.txt (w%c3%b8.txt) instead of proper name. With this bug, it is impossible to manage multilingual file names. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30195 -- Edit this bug report at http://bugs.php.net/?id=30195&edit=1
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: maxime dot pacary at freesbee dot fr Reported By: percy at savant dot us Status: No Feedback Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: Sorry, it was not GB2313 but GB2312 of course. Previous Comments: [2005-09-20 19:32:29] maxime dot pacary at winsoft dot fr 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 GB2313 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 [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] [EMAIL PROTECTED] Note that all of these are PHP code, so paste it within . [2005-02-17 15:20:57] [EMAIL PROTECTED] You might have shown strings of a native encoding as UTF-8 in your browser, most likely because of wrong Content-Type. Try putting one of the following at the top of your script and let's see what'll happen: CP936 (Simplified Chinese): header('Content-Type', 'text/html; charset=GB2312'); CP949 (Korean): header('Content-Type', 'text/html; charset=EUC-KR'); CP950 (Traditional Chinese): header('Content-Type', 'text/html; charset=BIG5'); CP932 (Japanese): header('Content-Type', 'text/html; charset=Shift_JIS'); [2005-01-28 18:02:07] moleary at preg dot org This is also the case for Japanese characters on the Windows platform. A note in the PHP manual says that opendir() uses ISO 8859-1 by default on WIndows installations. REPRO: 1) Install East Asian language supprto to XP through the Regioanl languages control panel 2) add a file with Japanese characters as the name (I copied a couple strings from the asahi.com web site) ACTUAL: 1) These same characters as text will be presented properly with the proper code page and/or header encoding. 2) The characters are not correctly parsed when looping through the contents of an opendir() on the directory in which you placed the file you created under the repro steps. EXPECTED: Ability to define charset for opendir(), or at very least use a more standard UTF-8 instead of ISO 8859-1 so that Asian named files can have their proper names returned by opendir() The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30195 -- Edit this bug report at http://bugs.php.net/?id=30195&edit=1
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: maxime dot pacary at winsoft dot fr Reported By: percy at savant dot us Status: No Feedback Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: 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 GB2313 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 Previous Comments: [2005-02-25 01:00:07] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2005-02-17 15:22:16] [EMAIL PROTECTED] Note that all of these are PHP code, so paste it within . [2005-02-17 15:20:57] [EMAIL PROTECTED] You might have shown strings of a native encoding as UTF-8 in your browser, most likely because of wrong Content-Type. Try putting one of the following at the top of your script and let's see what'll happen: CP936 (Simplified Chinese): header('Content-Type', 'text/html; charset=GB2312'); CP949 (Korean): header('Content-Type', 'text/html; charset=EUC-KR'); CP950 (Traditional Chinese): header('Content-Type', 'text/html; charset=BIG5'); CP932 (Japanese): header('Content-Type', 'text/html; charset=Shift_JIS'); [2005-01-28 18:02:07] moleary at preg dot org This is also the case for Japanese characters on the Windows platform. A note in the PHP manual says that opendir() uses ISO 8859-1 by default on WIndows installations. REPRO: 1) Install East Asian language supprto to XP through the Regioanl languages control panel 2) add a file with Japanese characters as the name (I copied a couple strings from the asahi.com web site) ACTUAL: 1) These same characters as text will be presented properly with the proper code page and/or header encoding. 2) The characters are not correctly parsed when looping through the contents of an opendir() on the directory in which you placed the file you created under the repro steps. EXPECTED: Ability to define charset for opendir(), or at very least use a more standard UTF-8 instead of ISO 8859-1 so that Asian named files can have their proper names returned by opendir() [2004-12-27 15:39:53] dev at glossword dot info There is the same problem with php 5.0.2. How to reproduce: 1. Create file wøاアいנ.txt (urlencoded string is w%d1%88%d8%a7%e3%82%a2%e3%81%84%d7%a0.txt) 2. Read directory, readdir(). 3. You'll get wø.txt (w%c3%b8.txt) instead of proper name. With this bug, it is impossible to manage multilingual file names. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/30195 -- Edit this bug report at http://bugs.php.net/?id=30195&edit=1
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: moleary at preg dot org Reported By: percy at savant dot us Status: Open Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: This is also the case for Japanese characters on the Windows platform. A note in the PHP manual says that opendir() uses ISO 8859-1 by default on WIndows installations. REPRO: 1) Install East Asian language supprto to XP through the Regioanl languages control panel 2) add a file with Japanese characters as the name (I copied a couple strings from the asahi.com web site) ACTUAL: 1) These same characters as text will be presented properly with the proper code page and/or header encoding. 2) The characters are not correctly parsed when looping through the contents of an opendir() on the directory in which you placed the file you created under the repro steps. EXPECTED: Ability to define charset for opendir(), or at very least use a more standard UTF-8 instead of ISO 8859-1 so that Asian named files can have their proper names returned by opendir() Previous Comments: [2004-12-27 15:39:53] dev at glossword dot info There is the same problem with php 5.0.2. How to reproduce: 1. Create file wøاアいנ.txt (urlencoded string is w%d1%88%d8%a7%e3%82%a2%e3%81%84%d7%a0.txt) 2. Read directory, readdir(). 3. You'll get wø.txt (w%c3%b8.txt) instead of proper name. With this bug, it is impossible to manage multilingual file names. [2004-11-18 18:50:04] phoenix95 at hotmail dot com I'm not 100% sure we have the same problem... What I experienced is readdir choking on directory names with special characters like an e acute. I use PHP 4.3.9 in debug mode from the Komodo v.3 IDE on Windows XP Pro SP2 english. This happens with the PEAR package File_Find::mapTreeMultiple(). [2004-09-23 16:51:58] percy at savant dot us The code: $dir= 'test'; $files1 = scandir($dir); print_r($files1); Result: subdir ¤¤¤å a dkeij PHPinfo: System Windows NT IBM99L9V8F 5.1 build 2600 Build Date Aug 12 2004 23:30:01 Configure Command cscript /nologo configure.js "--with-gd=shared" "--enable-snapshot-build" Server API ISAPI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20031224 PHP Extension 20040412 Zend Extension 220040412 Debug Build no Thread Safety enabled IPv6 Support enabled Registered PHP Streams php, file, http, ftp, compress.zlib Registered Stream Socket Transports tcp, udp This program makes use of the Zend Scripting Language Engine: Zend Engine v2.0.1, Copyright (c) 1998-2004 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference Off Off allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_globals_jit On On auto_prepend_file no value no value browscap no value no value default_charset utf-8 utf-8 default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors Off Off display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2047 2047 expose_php On On extension_dir c:\php\ext c:\php\ext file_uploads On On highlight.bg #FF #FF highlight.comment #FF8000 #FF8000 highlight.default #BB #BB highlight.html #00 #00 highlight.keyword #007700 #007700 highlight.string #DD #DD html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .;C:\php5\pear .;C:\php5\pear log_errors On On log_errors_max_len 1024 1024 magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off mail.force_extra_parameters no value no value max_execution_time 30 30 max_input_time 60 60 open_basedir no value no value output_buffering 4096 4096 output_handler mb_output_handler mb_output_handler post_max_size 8M 8M precision 14 14 register_argc_argv Off Off register_globals Off Off register_long_arrays On On report_memleaks On On report_zend_debug On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: dev at glossword dot info Reported By: percy at savant dot us Status: Open Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: There is the same problem with php 5.0.2. How to reproduce: 1. Create file wøاアいנ.txt (urlencoded string is w%d1%88%d8%a7%e3%82%a2%e3%81%84%d7%a0.txt) 2. Read directory, readdir(). 3. You'll get wø.txt (w%c3%b8.txt) instead of proper name. With this bug, it is impossible to manage multilingual file names. Previous Comments: [2004-11-18 18:50:04] phoenix95 at hotmail dot com I'm not 100% sure we have the same problem... What I experienced is readdir choking on directory names with special characters like an e acute. I use PHP 4.3.9 in debug mode from the Komodo v.3 IDE on Windows XP Pro SP2 english. This happens with the PEAR package File_Find::mapTreeMultiple(). [2004-09-23 16:51:58] percy at savant dot us The code: $dir= 'test'; $files1 = scandir($dir); print_r($files1); Result: subdir ¤¤¤å a dkeij PHPinfo: System Windows NT IBM99L9V8F 5.1 build 2600 Build Date Aug 12 2004 23:30:01 Configure Command cscript /nologo configure.js "--with-gd=shared" "--enable-snapshot-build" Server API ISAPI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20031224 PHP Extension 20040412 Zend Extension 220040412 Debug Build no Thread Safety enabled IPv6 Support enabled Registered PHP Streams php, file, http, ftp, compress.zlib Registered Stream Socket Transports tcp, udp This program makes use of the Zend Scripting Language Engine: Zend Engine v2.0.1, Copyright (c) 1998-2004 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference Off Off allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_globals_jit On On auto_prepend_file no value no value browscap no value no value default_charset utf-8 utf-8 default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors Off Off display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2047 2047 expose_php On On extension_dir c:\php\ext c:\php\ext file_uploads On On highlight.bg #FF #FF highlight.comment #FF8000 #FF8000 highlight.default #BB #BB highlight.html #00 #00 highlight.keyword #007700 #007700 highlight.string #DD #DD html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .;C:\php5\pear .;C:\php5\pear log_errors On On log_errors_max_len 1024 1024 magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off mail.force_extra_parameters no value no value max_execution_time 30 30 max_input_time 60 60 open_basedir no value no value output_buffering 4096 4096 output_handler mb_output_handler mb_output_handler post_max_size 8M 8M precision 14 14 register_argc_argv Off Off register_globals Off Off register_long_arrays On On report_memleaks On On report_zend_debug On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from no value no value sendmail_path no value no value serialize_precision 100 100 short_open_tag On On SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 10M 10M upload_tmp_dir no value no value user_dir no value no value variables_order GPCS GPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On zend.ze1_compatibility_mode Off Off bcmath BCMath support enabled calendar Calendar support enabled com_dotnet COM support enabled DCOM support disabled .Net support enabled Directive Local Value Master Value com.allow_dcom 0 0 com.autoregister_casesensitive 1 1 com.autoregister_typelib 0 0 com.autoregister_verbose 0 0 com.code_page no value no value com.typelib_file no value no value ctype ctype functions enabled dom DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.6.11 HTML S
#30195 [Com]: scandir etc cannot read Chinese file/folder name
ID: 30195 Comment by: phoenix95 at hotmail dot com Reported By: percy at savant dot us Status: Open Bug Type: *Directory/Filesystem functions Operating System: windows xp/2003 PHP Version: 5CVS-2004-09-22 (dev) New Comment: I'm not 100% sure we have the same problem... What I experienced is readdir choking on directory names with special characters like an e acute. I use PHP 4.3.9 in debug mode from the Komodo v.3 IDE on Windows XP Pro SP2 english. This happens with the PEAR package File_Find::mapTreeMultiple(). Previous Comments: [2004-09-23 16:51:58] percy at savant dot us The code: $dir= 'test'; $files1 = scandir($dir); print_r($files1); Result: subdir ¤¤¤å a dkeij PHPinfo: System Windows NT IBM99L9V8F 5.1 build 2600 Build Date Aug 12 2004 23:30:01 Configure Command cscript /nologo configure.js "--with-gd=shared" "--enable-snapshot-build" Server API ISAPI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20031224 PHP Extension 20040412 Zend Extension 220040412 Debug Build no Thread Safety enabled IPv6 Support enabled Registered PHP Streams php, file, http, ftp, compress.zlib Registered Stream Socket Transports tcp, udp This program makes use of the Zend Scripting Language Engine: Zend Engine v2.0.1, Copyright (c) 1998-2004 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference Off Off allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_globals_jit On On auto_prepend_file no value no value browscap no value no value default_charset utf-8 utf-8 default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors Off Off display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2047 2047 expose_php On On extension_dir c:\php\ext c:\php\ext file_uploads On On highlight.bg #FF #FF highlight.comment #FF8000 #FF8000 highlight.default #BB #BB highlight.html #00 #00 highlight.keyword #007700 #007700 highlight.string #DD #DD html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .;C:\php5\pear .;C:\php5\pear log_errors On On log_errors_max_len 1024 1024 magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off mail.force_extra_parameters no value no value max_execution_time 30 30 max_input_time 60 60 open_basedir no value no value output_buffering 4096 4096 output_handler mb_output_handler mb_output_handler post_max_size 8M 8M precision 14 14 register_argc_argv Off Off register_globals Off Off register_long_arrays On On report_memleaks On On report_zend_debug On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from no value no value sendmail_path no value no value serialize_precision 100 100 short_open_tag On On SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 10M 10M upload_tmp_dir no value no value user_dir no value no value variables_order GPCS GPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On zend.ze1_compatibility_mode Off Off bcmath BCMath support enabled calendar Calendar support enabled com_dotnet COM support enabled DCOM support disabled .Net support enabled Directive Local Value Master Value com.allow_dcom 0 0 com.autoregister_casesensitive 1 1 com.autoregister_typelib 0 0 com.autoregister_verbose 0 0 com.code_page no value no value com.typelib_file no value no value ctype ctype functions enabled dom DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.6.11 HTML Support enabled XPath Support enabled XPointer Support enabled Schema Support enabled RelaxNG Support enabled exif EXIF Support enabled EXIF Version 1.4 $Id: exif.c,v 1.162 2004/03/16 20:58:01 derick Exp $ Supported EXIF Version 0220 Supported filetypes JPEG,TIFF ftp FTP support enabled gd GD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with f