ID:               30014
 Comment by:       ppmm at wuxinan dot net
 Reported By:      cvictor at pchome dot com dot tw
 Status:           Open
 Bug Type:         Directory function related
 Operating System: Windows XP Pro
 PHP Version:      5.0.1
 New Comment:

related to bug# 30105
http://bugs.php.net/bug.php?id=30105


Previous Comments:
------------------------------------------------------------------------

[2004-09-07 20:26:26] cvictor at pchome dot com dot tw

Description:
------------
pathinfo() doesn't handle pathname in multibyte well. This error can be
reporduced under big5 and utf-8 charset, no matter converting the whole
source php file or using mb_convert_encoding() inline.
This error only occurs when the first character of basename is a
Chinese character.

I didn't recompile PHP bin, and modules used seem not relevent. My
php.ini is adapted from php.ini-recommended. The OS is a Traditional
Chinese version.

Reproduce code:
---------------
<?php
$fp = '/var/明細.txt';
var_dump(pathinfo($fp));
$fp = '/var/a明細.txt';
var_dump(pathinfo($fp));
?>

Expected result:
----------------
array(3) {
  ["dirname"]=>
  string(4) "/var"
  ["basename"]=>
  string(8) "明細.txt"
  ["extension"]=>
  string(3) "txt"
}
array(3) {
  ["dirname"]=>
  string(4) "/var"
  ["basename"]=>
  string(8) "a明細.txt"
  ["extension"]=>
  string(3) "txt"
}

Actual result:
--------------
array(3) {
  ["dirname"]=>
  string(4) "/var"
  ["basename"]=>
  string(4) ".txt"
  ["extension"]=>
  string(3) "txt"
}
array(3) {
  ["dirname"]=>
  string(4) "/var"
  ["basename"]=>
  string(8) "a明細.txt"
  ["extension"]=>
  string(3) "txt"
}


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


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

Reply via email to