php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34314 function basename & pathinfo is wrong for chinese filename.
Submitted: 2005-08-31 09:24 UTC Modified: 2005-08-31 09:38 UTC
From: neo at csba dot com dot cn Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.0.4 OS: WIN2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: neo at csba dot com dot cn
New email:
PHP Version: OS:

 

 [2005-08-31 09:24 UTC] neo at csba dot com dot cn
Description:
------------
i use function basename and pathinfo proess chinese filename, 

$filename = "D:\\ftpserver\\?м???????ѧ?ڶ?ʮһ??.wmv";

echo basename($filename);

result is : .wmv


$at = pathinfo($filename);
echo $at['basename'];

reseult is : .wmv

is not ?м???????ѧ?ڶ?ʮһ??.wmv




Reproduce code:
---------------
$filename = "D:\\ftpserver\\?м???????ѧ?ڶ?ʮһ??.wmv";

echo basename($filename);

$at = pathinfo($filename);
echo $at['basename'];

Expected result:
----------------
?м???????ѧ?ڶ?ʮһ??.wmv

Actual result:
--------------
.wmv

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-31 09:38 UTC] sniper@php.net
Use addslashes() on the filename.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 20:01:35 2025 UTC