php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39660 no multibyte support for Directory/Filesystem function
Submitted: 2006-11-28 14:39 UTC Modified: 2006-11-28 14:50 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: dominikseifert at yahoo dot de Assigned:
Status: Wont fix Package: *Directory/Filesystem functions
PHP Version: 5.2.0 OS: Any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dominikseifert at yahoo dot de
New email:
PHP Version: OS:

 

 [2006-11-28 14:39 UTC] dominikseifert at yahoo dot de
Description:
------------
Directory/Filesystem functions do not work with multibyte-strings.
When eg trying to open or move a file or directory with a chinese filename, the file or directory being accessed or created has a completely messed up name.
Could not find a work-around.

Reproduce code:
---------------
// Multibyte support is enabled (UTF-8)

// change this correspondingly for your FS
$origFile = "c:/myfile.txt";

$chineseName = $_POST["filename"];

echo "name: " . $chineseName;
echo "len: " . mb_strlen($chineseName);
echo "sb-len: " . strlen($chineseName);

$dir = dirname($origFile);
rename($origFile, $dir . "/$chineseName") or die("Could not rename file: $origFile");

Expected result:
----------------
name: 中文字.txt
len: 7
sb-len: 13


Actual result:
--------------
Actual filename is:
中文字.txt

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-28 14:50 UTC] tony2001@php.net
Yes, you have to wait for PHP6 to get decent Unicode support.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC