From 401dc3dbb9089e2266591d80f3d3c90f6aff5cbb 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 435660ecd94..5905c00b902 100644 --- a/lib/filestorage/zip_archive.php +++ b/lib/filestorage/zip_archive.php @@ -544,6 +544,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');