We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0443bcf commit a46f3aaCopy full SHA for a46f3aa
1 file changed
src/Zip.php
@@ -629,12 +629,14 @@ protected function header2fileinfo($header)
629
* similar enough. CP437 seems not to be available in mbstring. Lastly falls back to keeping the
630
* string as is, which is still better than nothing.
631
*
632
+ * On some systems iconv is available, but the codepage is not. We also check for that.
633
+ *
634
* @param $string
635
* @return string
636
*/
637
protected function cpToUtf8($string)
638
{
- if (function_exists('iconv')) {
639
+ if (function_exists('iconv') && @iconv_strlen('', 'CP437') !== false) {
640
return iconv('CP437', 'UTF-8', $string);
641
} elseif (function_exists('mb_convert_encoding')) {
642
return mb_convert_encoding($string, 'UTF-8', 'CP850');
0 commit comments