1--TEST--
2Bug #71509 Zip problem with swedish letters in filename.
3--SKIPIF--
4<?php
5include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
6
7skip_if_not_win();
8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
9skip_if_no_required_exts("zip");
10
11?>
12--CONFLICTS--
13bug71509
14--FILE--
15<?PHP
16// ���
17
18include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
19
20$item = iconv("ISO-8859-1", "UTF-8", "R�d_Statistics"); // cp1252
21$prefix = create_data("bug71509", "$item.txt");
22$testfile_zip = $prefix . DIRECTORY_SEPARATOR . "$item.txt";
23$outputfile_zip = $prefix . DIRECTORY_SEPARATOR . "$item.zip";
24
25var_dump(file_exists($testfile_zip));
26
27$zipfile = new ZipArchive;
28
29$return_code = $zipfile->open($outputfile_zip, ZipArchive::CREATE);
30if ($return_code != true) die("Failed to open file: " . $return_code);
31
32$return_code = $zipfile->addfile($testfile_zip, basename($testfile_zip));
33if ($return_code != true) print("Failed to add file: " . $zipfile->getStatusString());
34
35$return_code = $zipfile->close();
36if ($return_code != true) die("Failed to close archive: " . $zipfile->getStatusString());
37
38var_dump(file_exists($outputfile_zip));
39
40remove_data("bug71509");
41?>
42--EXPECT--
43bool(true)
44bool(true)
45