note 115566 added to function.ziparchive-addfromstring
| From: | anticom at hotmail dot de | Date: | Mon, 18 Aug 2014 08:51:26 +0000 |
| Subject: | note 115566 added to function.ziparchive-addfromstring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200208@lists.php.net to get a copy of this message | ||
I was having problems with special chars in UTF-8 encoded file names. I found, that the Zip spec
seems to specify IBM437 as valid encoding.
Doing:
<?php
//...
$filename = 'exämple.ext';
$encodedFilename = iconv('utf-8', 'IBM437', $filename);
$zip->addFromString($encodedFilename, 'foo');
//...
?>
fixed those problems for me.
----
Server IP: 72.52.91.14
Probable Submitter: 95.131.102.214
----
Manual Page -- http://php.net/manual/en/function.ziparchive-addfromstring.php
Edit -- https://master.php.net/note/edit/115566
Del: integrated -- https://master.php.net/note/delete/115566/integrated
Del: useless -- https://master.php.net/note/delete/115566/useless
Del: bad code -- https://master.php.net/note/delete/115566/bad+code
Del: spam -- https://master.php.net/note/delete/115566/spam
Del: non-english -- https://master.php.net/note/delete/115566/non-english
Del: in docs -- https://master.php.net/note/delete/115566/in+docs
Del: other reasons-- https://master.php.net/note/delete/115566
Reject -- https://master.php.net/note/reject/115566
Search -- https://master.php.net/manage/user-notes.php