#25004 [Opn->Bgs]: Uploaded file name truncated if accent present

From: Date: Sun, 10 Aug 2003 16:11:56 +0000
Subject: #25004 [Opn->Bgs]: Uploaded file name truncated if accent present
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45660@lists.php.net to get a copy of this message
ID: 25004 Updated by: sniper@php.net Reported By: spud at nothingness dot org -Status: Open +Status: Bogus Bug Type: *Languages/Translation Operating System: RedHat 7.2 PHP Version: 4.3.2 New Comment: Works fine with latest CVS (and with PHP 4.3.3RC3 too) Bogusing since you failed the first rule of submitting a bug report: Try the latest CVS snapshot first. Previous Comments: ------------------------------------------------------------------------ [2003-08-10 10:54:57] spud at nothingness dot org Description: ------------ On a standard form upload, if the user uploads a file with a name like "épice.jpg" (with an acute accent on the e), PHP reports the $_FILES[0]['name'] as "foo_e", dropping the accent and ALL following characters, including the suffix. I understand the perhaps the file upload can't handle the accented characters, but it seems incorrect to strip off the rest of the filename, including characters that are still legitimate. I don't know if this is a PHP bug or not, but it seems very limiting for non-English file uploads, where accented characters in a filename are common. Reproduce code: --------------- Example: with a page like <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <form action="test.php" method="post" enctype="multipart/form-data"> <input type="file" name="upload"> <input type="submit" name="submit" value="submit"> </form> <? if (isset($_POST['submit'])) { print_r($_FILES); } ?> upload a file named "épice.jpg", and PHP will report the filename as "e". Expected result: ---------------- I expect $_FILES[0]['name'] to be "épice.jpg", or at least "epice.jpg". Actual result: -------------- Filename reported as "e". ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25004&edit=1

« previous php.bugs (#45660) next »