|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-01-25 11:20 UTC] ab@php.net
-Status: Open
+Status: Feedback
[2019-01-25 11:20 UTC] ab@php.net
[2019-02-03 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
Description: ------------ Hello, I'm working in windows (french) on a console php script with Windows-1252 charset. I'm change default_charset seting in php.ini : default_charset = "Windows-1252" My script convert a .ods file in a .sql script with using phpspreadsheet lib. I'm use a batch file to launch my php script. This allow drag-and-drop file over .bat to launch conversion. Problem : This not work with filename countain accentuated char. Problem is in ZipArchive::Open(). Filename must be encoded with UTF-8 charset to work. Before open file, phpspreadsheet verify if file exist and readable with use is_file() and is_readable(). In this function, filename must be encoded with default_charset setting. So i have a problem : If I translate filename to UTF-8, it's not work (is_file() block) but when i left CP1252 charset, ZipArchive::Open() not work. This is inconsistent. Can you modify ZipArchive::Open()for this function use default_charset setting for filename parameters ? Ty Test script: --------------- // For just test ZipArchive : $zip = new ZipArchive(); $res = $zip->open("Différence.ods"); if ($res!== true) { echo 'FAIL'; } else { echo 'OK'; } Expected result: ---------------- OK (In Windows with "Différence.ods" LibreOffice calc file AND default_charset = "Windows-1252" in php.ini) Actual result: -------------- FAIL (In Windows with "Différence.ods" LibreOffice calc file AND default_charset = "Windows-1252" in php.ini)