|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71509 Zip problem with swedish letters in filename.
Submitted: 2016-02-03 12:56 UTC Modified: 2016-08-08 10:02 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: nikolas dot engstrom at marvaco dot se Assigned: ab (profile)
Status: Closed Package: zip (PECL)
PHP Version: 7.0.2 OS: windows 7
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: nikolas dot engstrom at marvaco dot se
New email:
PHP Version: OS:


 [2016-02-03 12:56 UTC] nikolas dot engstrom at marvaco dot se
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:
// åöä

$testfile = "C:\\Users\\nikolasengstrom\\Desktop\\Röd_Statistics.pdf";
$outputfile = "C:\\Users\\nikolasengstrom\\Desktop\\";

$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());


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-19 04:34 UTC] yasuhiro dot oguro dot 7 at gmail dot com
I saw load entry from zip in CentOS.
I think that, ZipArchive library cant use MultiByte String without UTF-8.
 [2016-08-08 10:02 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-08-08 10:02 UTC]
Fixed in PHP 7.1, please read UPGRADING and use UTF-8.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 09:01:29 2024 UTC