|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2019-03-11 22:55 UTC] kalle@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: bagder
[2019-03-11 22:55 UTC] kalle@php.net
[2019-03-11 23:06 UTC] kalle@php.net
-Assigned To: bagder
+Assigned To: ab
[2019-03-11 23:06 UTC] kalle@php.net
[2019-03-12 00:21 UTC] anrdaemon at freemail dot ru
[2019-03-12 11:04 UTC] ab@php.net
-Status: Assigned
+Status: Open
[2019-03-12 11:04 UTC] ab@php.net
[2019-03-12 20:46 UTC] anrdaemon at freemail dot ru
[2019-03-13 09:27 UTC] kalle@php.net
-Status: Assigned
+Status: Wont fix
-Assigned To: ab
+Assigned To:
[2019-03-13 09:27 UTC] kalle@php.net
[2019-03-13 21:13 UTC] anrdaemon at freemail dot ru
[2019-03-15 13:56 UTC] anrdaemon at freemail dot ru
[2019-04-15 17:17 UTC] cmb@php.net
-Summary: CURLFile unable to handle UNICODE filenames
+Summary: CURLFile should support UNICODE filenames
-Status: Wont fix
+Status: Re-Opened
-Type: Bug
+Type: Feature/Change Request
-Assigned To:
+Assigned To: cmb
[2019-04-15 17:17 UTC] cmb@php.net
[2019-04-16 08:43 UTC] cmb@php.net
[2019-04-29 08:25 UTC] cmb@php.net
-Status: Re-Opened
+Status: Closed
[2019-04-29 08:25 UTC] cmb@php.net
[2019-12-09 09:34 UTC] cmb@php.net
[2020-01-06 14:36 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ CURLFile starting from PHP 7.1 is unable to handle local paths containing UNICODE sequences. The workaround is to iconv() the path to single-byte character set used by WinAPI non-widestring family of functions on a given OS installation. But that's limiting the usability of the language to laughable levels. $ php -i | grep -E "chars|encod" default_charset => CP866 => CP866 input_encoding => CP866 => CP866 internal_encoding => UTF-8 => UTF-8 output_encoding => CP866 => CP866 zend.script_encoding => no value => no value exif.encode_jis => no value => no value exif.encode_unicode => ISO-8859-15 => ISO-8859-15 iconv.input_encoding => no value => no value iconv.internal_encoding => no value => no value iconv.output_encoding => no value => no value mailparse.def_charset => UTF-8 => UTF-8 HTTP input encoding translation => disabled mbstring.encoding_translation => Off => Off mbstring.internal_encoding => no value => no value Test script: --------------- <?php // Cyrillic capital letter A // tempnam() returns path encoded in internal_encoding $name = tempnam(__DIR__, "\u{0410}"); //print bin2hex(basename($name)); file_put_contents($name, "Test."); $file = new \CURLFile($name, null, "file"); // $file = new \CURLFile(iconv("UTF-8", "CP1251", $name), null, "file"); // Rather arbitrary workaround $curl = curl_init($argv[1] ?: "http://example.org/post.php"); curl_setopt_array($curl, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => [ "file" => $file, ], CURLOPT_VERBOSE => true, ]); $rc = curl_exec($curl); if($rc === false) { $err = curl_errno($curl); error_log(curl_strerror($err) . " ($err): " . curl_error($curl)); die; } print "$rc"; Expected result: ---------------- Successful upload. Actual result: -------------- Failed to open/read local data from file/application (26):