php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64506 PHP can not read or write file correctly if file name have special char like š
Submitted: 2013-03-25 02:07 UTC Modified: 2013-05-08 21:32 UTC
From: vibbow at hotmail dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5.4.13 OS: Windows 7
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: vibbow at hotmail dot com
New email:
PHP Version: OS:

 

 [2013-03-25 02:07 UTC] vibbow at hotmail dot com
Description:
------------
System envirement:
Windows 8 x64 Simplified Chinese
PHP 5.4.13 nts (Non debug version, download from windows.php.net)

1. This problem only happened on Windows (I tried on linux, it works fine)

2. If I want to save a file with special character in file name (For example, I want to save file to "š.txt"), the file name will actually become "拧.txt"

3. If in my folder, I have a file named š.txt, when I use scandir to list all the files in thsi folder, this file will list as "?.txt"

Test script:
---------------
<?php file_put_contents('š.txt', 'test'); ?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-25 02:16 UTC] pajoye@php.net
duplicate of bugs about unicode API support for file operations.

Temporary solution is to either choose the right encoding (windows encoding), 
mbstring supports conversions for all windows encoding.
 [2013-03-25 02:17 UTC] pajoye@php.net
-Status: Open +Status: Duplicate
 [2013-03-25 02:20 UTC] vibbow at hotmail dot com
For the second part.

I had try convert the file name to UTF-8, GBK or GB2312 encode,
but none of these encode will save the file in correct file name

For the third part.

I had try convert the filename to all encode which mb_convert support,
But none of any encode will work.
 [2013-05-08 17:57 UTC] cataphract@php.net
-Status: Duplicate +Status: Closed
 [2013-05-08 17:57 UTC] cataphract@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f3c3862ca5c136bb123c1e60e1f163bb7efcf3f
Log: Fix bug #64506: fix build with --disable-ipv6
 [2013-05-08 17:58 UTC] cataphract@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8687332e086bc332c99692c099514be7996a2139
Log: Fix bug #64506: fix build with --disable-ipv6
 [2013-05-08 21:32 UTC] pajoye@php.net
Re open, wrong # in commit log.
 [2013-05-08 21:32 UTC] pajoye@php.net
-Status: Closed +Status: Re-Opened
 [2013-05-08 21:32 UTC] pajoye@php.net
-Status: Re-Opened +Status: Duplicate
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8687332e086bc332c99692c099514be7996a2139
Log: Fix bug #64506: fix build with --disable-ipv6
 [2013-11-17 09:31 UTC] laruence@php.net
-Status: Duplicate +Status: Closed
 [2013-11-17 09:31 UTC] laruence@php.net
Automatic comment on behalf of glopes@nebm.ist.utl.pt
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f3c3862ca5c136bb123c1e60e1f163bb7efcf3f
Log: Fix bug #64506: fix build with --disable-ipv6
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 10:01:28 2024 UTC