|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35721 uploaded unicode filenames converts to underscore
Submitted: 2005-12-17 16:07 UTC Modified: 2005-12-17 21:25 UTC
From: omidmr at gmail dot com Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 5.1.1 OS: Windows XP
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: omidmr at gmail dot com
New email:
PHP Version: OS:


 [2005-12-17 16:07 UTC] omidmr at gmail dot com
When i upload a file with unicode filename (in my case, it is in Persian) PHP convert each character to an underscore sign (_).

for example when i upload a file, named "علی.php", it will convert to "___.php"

the written program works fine with PHP 5.0.5.


Reproduce code:
the very very simple code that i tested is:

<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file"><br>
<input type="submit" name="submit" value="submit">

    echo '<pre>';
    echo '</pre>';

Expected result:
    [name] => سلام.php
    [type] => application/octet-stream
    [tmp_name] => D:\php\tmp\php4D.tmp
    [error] => 0
    [size] => 0

Actual result:
    [name] => ____.php
    [type] => application/octet-stream
    [tmp_name] => D:\php\tmp\php4D.tmp
    [error] => 0
    [size] => 0


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-17 16:24 UTC]
You have to wait for PHP6, Unicode support will be added only in this version.
 [2005-12-17 16:44 UTC] omidmr at gmail dot com
Thanks Tony,

but PHP supported unicode in uploading file functions. as i told, PHP 5.0.5 works fine.

the bug directly doesn't related to filesystem functions, because i don't write file on the disk.

Additional comments:
1- i tested it with 5.1.2-dev (current last release!) too.
and it has the bug too.

2- i tested it with 6.0.0-dev (current last release!) too.
and it has the bug too.

3- and again, this code, works fine [at least] with PHP 5.0.5
 [2005-12-17 19:54 UTC] omidmr at gmail dot com
sorry, i found it is bogus!
it is windows/firefox bug!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 00:01:30 2024 UTC