Answer the question
In order to leave comments, you need to log in
ZipArchive and encoding
I know it was a similar question, but still. There is a code:
$zip = new ZipArchive();
$zip->open(dirname(__FILE__).'/test.zip', ZIPARCHIVE::CREATE);
$name = 'файл 1';
$zip->addFile($name);
$zip->close();
which adds the file "file 1" to the archive. But due to encoding problems, the name is "файÐ" 1". The second day I fight, I did not find a solution, except for a crutch in the form of exec ('zip ....'). Maybe someone here can help. Answer the question
In order to leave comments, you need to log in
Set file names in a different encoding?
The displayed is very similar to the situation when the name should be in co1251, but written in utf8
It's funny, Google found my own answer on SO:
stackoverflow.com/a/6163463/680786
The problem with the Russian encoding may be related to the locale under which php + nginx (apache) works,
find out the locale
from me like this:
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"...
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8" ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question