nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit cdf83f580ab1ad67f18f04d0bb478353dd7dde38
parent 9d1901392914aa9a44a98f54c1fcb0ee5309383c
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Sat, 25 Feb 2017 22:55:20 +0300

[track list] patched JSUnzip to support utf-8

Diffstat:
Msrc/vendored/github.com/augustl/js-unzip/js-unzip.js | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/vendored/github.com/augustl/js-unzip/js-unzip.js b/src/vendored/github.com/augustl/js-unzip/js-unzip.js @@ -1,4 +1,8 @@ (function (GLOBAL) { + function decodeUTF8(s){ + return decodeURIComponent(escape(s)); + } + var JSUnzip = function (fileContents) { this.fileContents = new JSUnzip.BigEndianBinaryStream(fileContents); } @@ -39,9 +43,6 @@ throw "File contains encrypted entry. Not supported."; } - if (this.isUsingUtf8()) { - throw "File is using UTF8. Not supported."; - } this.crc32 = binaryStream.getNextBytesAsNumber(4); this.compressedSize = binaryStream.getNextBytesAsNumber(4); @@ -64,6 +65,11 @@ } binaryStream.getNextBytesAsNumber(16); //Skip the descriptor and move to beginning of next ZipEntry } + + if (this.isUsingUtf8()) { + this.fileName = decodeUTF8(this.fileName); + } + } JSUnzip.ZipEntry.prototype = {