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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

History

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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 09:01:31 2024 UTC