|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-05-19 04:34 UTC] yasuhiro dot oguro dot 7 at gmail dot com
[2016-08-08 10:02 UTC] ab@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: ab
[2016-08-08 10:02 UTC] ab@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 23:00:01 2025 UTC |
Description: ------------ When using filenames with special Swedish letters for example "Röd_Statistics.pdf". It's not possible to add files into a zip archive file. Test script: --------------- <?PHP // åöä ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); $testfile = "C:\\Users\\nikolasengstrom\\Desktop\\Röd_Statistics.pdf"; $outputfile = "C:\\Users\\nikolasengstrom\\Desktop\\Testing1.zip"; $zipfile = new ZipArchive; $return_code = $zipfile->open($outputfile, ZipArchive::CREATE); if ($return_code != true) die("Failed to open file: " . $return_code); $testfile_zip = mb_convert_encoding($testfile, "ISO-8859-1", "UTF-8"); $return_code = $zipfile->addfile($testfile_zip, substr($testfile, (strrpos($testfile, "\\") + 1))); if ($return_code != true) print("Failed to add file: " . $zipfile->getStatusString()); $return_code = $zipfile->close(); if ($return_code != true) die("Failed to close archive: " . $zipfile->getStatusString()); ?>