mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(zip) UTF8 -> UTF8Proto
This commit is contained in:
parent
c79ef4efeb
commit
03a255285e
1 changed files with 16 additions and 11 deletions
|
|
@ -3,13 +3,9 @@ var Util, Zip, pako;
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
/*jshint nonstandard:false */
|
||||
var UTF8 = {
|
||||
unescape: typeof unescape === 'function' ? unescape : decode
|
||||
};
|
||||
/*jshint nonstandard:true */
|
||||
|
||||
Zip = new ZipProto();
|
||||
var UTF8 = new UTF8Proto();
|
||||
|
||||
Zip = new ZipProto();
|
||||
|
||||
function ZipProto() {
|
||||
this.pack = function(str, callback) {
|
||||
|
|
@ -44,13 +40,23 @@ var Util, Zip, pako;
|
|||
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* jshint bitwise:false */
|
||||
/* unescape polyfill
|
||||
function UTF8Proto() {
|
||||
/*jshint nonstandard:true */
|
||||
var isUnescape = typeof unescape === 'function',
|
||||
func = isUnescape ? unescape : decode;
|
||||
|
||||
this.unescape = func;
|
||||
}
|
||||
|
||||
/*
|
||||
* unescape polyfill
|
||||
* http://unixpapa.com/js/querystring.html
|
||||
*/
|
||||
|
||||
function decode(s) {
|
||||
/*jshint bitwise:false */
|
||||
s = s.replace(/%([EF][0-9A-F])%([89AB][0-9A-F])%([89AB][0-9A-F])/gi,
|
||||
function(code,hex1,hex2,hex3) {
|
||||
var n, n3,
|
||||
|
|
@ -88,5 +94,4 @@ var Util, Zip, pako;
|
|||
|
||||
return s;
|
||||
}
|
||||
/* jshint bitwise:true */
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue