Permalink
Browse files

MDL-37407 add support for zh_cn unicode unzip

  • Loading branch information...
1 parent df93b15 commit 401dc3dbb9089e2266591d80f3d3c90f6aff5cbb @skodak skodak committed Jan 13, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/filestorage/zip_archive.php
@@ -544,6 +544,13 @@ protected function init_namelookup() {
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');

0 comments on commit 401dc3d

Please sign in to comment.