File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ protected function cpToUtf8($string)
654654 protected function utf8ToCp ($ string )
655655 {
656656 if (function_exists ('iconv ' )) {
657- return iconv ('UTF-8 ' , 'CP437 ' , $ string );
657+ return iconv ('UTF-8 ' , 'CP437//IGNORE ' , $ string );
658658 } elseif (function_exists ('mb_convert_encoding ' )) {
659659 return mb_convert_encoding ($ string , 'CP850 ' , 'UTF-8 ' );
660660 } else {
@@ -863,7 +863,7 @@ protected function encodeFilename($original)
863863 1 , // version
864864 crc32 ($ original ) // crc
865865 );
866- $ extra .= $ original ;
866+ $ extra .= $ original ;
867867
868868 return array ($ cp437 , $ extra );
869869 }
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ public function test_utf8() {
162162 $ zip = new Zip ();
163163 $ zip ->create ($ archive );
164164 $ zip ->addData ('tüst.txt ' , 'test ' );
165+ $ zip ->addData ('snowy☃.txt ' , 'test ' );
165166 $ zip ->close ();
166167 $ this ->assertFileExists ($ archive );
167168
@@ -170,6 +171,7 @@ public function test_utf8() {
170171 $ zip ->extract ($ extract );
171172
172173 $ this ->assertFileExists ($ extract .'/tüst.txt ' );
174+ $ this ->assertFileExists ($ extract .'/snowy☃.txt ' );
173175
174176 $ this ->nativeCheck ($ archive );
175177 $ this ->native7ZipCheck ($ archive );
You can’t perform that action at this time.
0 commit comments