From 231b02277700c267d7393c5b7174d6c61e33eaef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sun, 13 Jan 2013 12:30:04 +0100 Subject: [PATCH] MDL-37407 add support for zh_cn unicode unzip --- lib/filestorage/zip_archive.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/filestorage/zip_archive.php b/lib/filestorage/zip_archive.php index f7fe3c3a159..ba963935b1e 100644 --- a/lib/filestorage/zip_archive.php +++ b/lib/filestorage/zip_archive.php @@ -610,6 +610,13 @@ class zip_archive extends file_archive { case 'ISO-8859-6': $encoding = 'CP720'; break; case 'ISO-8859-7': $encoding = 'CP737'; break; case 'ISO-8859-8': $encoding = 'CP862'; break; + case 'UTF-8': + if ($winchar = get_string('localewincharset', 'langconfig')) { + // Most probably works only for zh_cn, + // if there are more problems we could add zipcharset to langconfig files. + $encoding = $winchar; + } + break; } } $newname = @textlib::convert($name, $encoding, 'utf-8');