version bump 1.13.0: node 10 deprecation
This commit is contained in:
parent
122f01a3c3
commit
58ebd1ff6c
@ -1,5 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
- "9"
|
||||
- "8"
|
||||
- "7"
|
||||
- "6"
|
||||
|
12
codepage.md
12
codepage.md
@ -565,7 +565,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.encode(cp,i.split(""),e);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.encode(cp,new Buffer(i),e);
|
||||
var buf = cptable.utils.encode(cp,Buffer.from(i),e);
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -593,7 +593,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.decode(cp,s.join?s.join(""):s);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.decode(cp,new Buffer(i));
|
||||
var buf = cptable.utils.decode(cp,Buffer.from(i));
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -603,7 +603,7 @@ describe('entry conditions', function() {
|
||||
};
|
||||
describe('decode', function() {
|
||||
it('CP 1252 : sbcs', function() { chkde(1252,[0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); }); /* "foobar" */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, new Buffer([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, Buffer.from([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
it('CP 936 : dbcs', function() { chkde(936, [0xd5, 0xe2, 0xca, 0xc7, 0xd6, 0xd0, 0xce, 0xc4, 0xd7, 0xd6, 0xb7, 0xfb, 0xb2, 0xe2, 0xca, 0xd4]);}); /* "这是中文字符测试" */
|
||||
});
|
||||
});
|
||||
@ -754,7 +754,7 @@ describe('failures', function() {
|
||||
```json>package.json
|
||||
{
|
||||
"name": "codepage",
|
||||
"version": "1.12.1",
|
||||
"version": "1.13.0",
|
||||
"author": "SheetJS",
|
||||
"description": "pure-JS library to handle codepages",
|
||||
"keywords": [ "codepage", "iconv", "convert", "strings" ],
|
||||
@ -767,7 +767,7 @@ describe('failures', function() {
|
||||
"buffer": "false"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "~2.13.1",
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -776,7 +776,7 @@ describe('failures', function() {
|
||||
"blanket": "~1.2.3",
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"@types/commander": "^2.9.0",
|
||||
"@types/commander": "^2.12.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
@ -48,9 +48,14 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
|
||||
var has_buf/*:boolean*/ = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E/*:EMap*/)/*:Buffer*/{
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys/*:Array<string>*/ = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -65,10 +70,10 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
var len = data.length;
|
||||
var out/*:Buffer*/, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(/*:: data instanceof Buffer && */Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -83,7 +88,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[/*::(*/data[i]/*:: :any)*/.charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -93,7 +98,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp/*:CPIndex*/)/*:Decoder*/ {
|
||||
var D/*:DMap*/ = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -101,7 +106,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
}
|
||||
return function sbcs_d(data/*:Data*/)/*:string*/ {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(/*::data instanceof Buffer && */Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -123,7 +128,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp/*:CPIndex*/)/*:Encoder*/ {
|
||||
var E/*:EMap*/ = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -132,7 +137,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data/*:StrData*/, ofmt/*:?string*/)/*:any*/ {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -166,7 +171,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp/*:CPIndex*/)/*:Decoder*/ {
|
||||
var D/*:DMap*/ = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -175,7 +180,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data/*:Data*/)/*:string*/ {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(/*::data instanceof Buffer && */Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -201,7 +206,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
magic_decode[65001] = function utf8_d(data/*:Data*/)/*:string*/ {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -230,7 +235,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
*/
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct /*::&& typeof data === "string" */? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -313,7 +318,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
if(data instanceof Buffer) throw "";
|
||||
*/
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C/*:CPEntry*/ = cpt[cp], E/*:EMap*/, M/*:string*/ = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -325,7 +330,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr/*:: && typeof data == 'string' */) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr/*:: && typeof data == 'string' */) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr/*:: && typeof data == 'string' */ ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -347,7 +352,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr/*:: && typeof data == 'string' */ ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -355,7 +360,7 @@ type DecoderMap = {[id:CPIndex]:Decoder};
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr/*:: && typeof data == 'string' */ ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
39
cputils.js
39
cputils.js
@ -41,9 +41,14 @@
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -58,10 +63,10 @@
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -76,7 +81,7 @@
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -86,7 +91,7 @@
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -94,7 +99,7 @@
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -116,7 +121,7 @@
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -125,7 +130,7 @@
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -159,7 +164,7 @@
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -168,7 +173,7 @@
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -194,7 +199,7 @@
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -219,7 +224,7 @@
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -298,7 +303,7 @@
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -310,7 +315,7 @@
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -332,7 +337,7 @@
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -340,7 +345,7 @@
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
File diff suppressed because one or more lines are too long
41
dist/cpexcel.full.js
vendored
41
dist/cpexcel.full.js
vendored
@ -1,6 +1,6 @@
|
||||
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@ -1018,9 +1018,14 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -1035,10 +1040,10 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -1053,7 +1058,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -1063,7 +1068,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -1071,7 +1076,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -1093,7 +1098,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -1102,7 +1107,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -1136,7 +1141,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -1145,7 +1150,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -1171,7 +1176,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -1196,7 +1201,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -1275,7 +1280,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -1287,7 +1292,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -1309,7 +1314,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -1317,7 +1322,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
2
dist/cpexcel.js
vendored
2
dist/cpexcel.js
vendored
@ -1,6 +1,6 @@
|
||||
/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖÜ¢Ł¥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
41
dist/cptable.full.js
vendored
41
dist/cptable.full.js
vendored
@ -1,6 +1,6 @@
|
||||
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@ -6388,9 +6388,14 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -6405,10 +6410,10 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -6423,7 +6428,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -6433,7 +6438,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -6441,7 +6446,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -6463,7 +6468,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -6472,7 +6477,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -6506,7 +6511,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -6515,7 +6520,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -6541,7 +6546,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -6566,7 +6571,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -6645,7 +6650,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -6657,7 +6662,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -6679,7 +6684,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -6687,7 +6692,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
2
dist/cptable.js
vendored
2
dist/cptable.js
vendored
@ -1,6 +1,6 @@
|
||||
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
39
dist/cputils.js
vendored
39
dist/cputils.js
vendored
@ -41,9 +41,14 @@
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -58,10 +63,10 @@
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -76,7 +81,7 @@
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -86,7 +91,7 @@
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -94,7 +99,7 @@
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -116,7 +121,7 @@
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -125,7 +130,7 @@
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -159,7 +164,7 @@
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -168,7 +173,7 @@
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -194,7 +199,7 @@
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -219,7 +224,7 @@
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -298,7 +303,7 @@
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -310,7 +315,7 @@
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -332,7 +337,7 @@
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -340,7 +345,7 @@
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
41
dist/sbcs.full.js
vendored
41
dist/sbcs.full.js
vendored
@ -1,6 +1,6 @@
|
||||
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@ -152,9 +152,14 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -169,10 +174,10 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -187,7 +192,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -197,7 +202,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -205,7 +210,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -227,7 +232,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -236,7 +241,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -270,7 +275,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -279,7 +284,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -305,7 +310,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -330,7 +335,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -409,7 +414,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -421,7 +426,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -443,7 +448,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -451,7 +456,7 @@ if (typeof module !== 'undefined' && module.exports && typeof DO_NOT_EXPORT_CODE
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
2
dist/sbcs.js
vendored
2
dist/sbcs.js
vendored
@ -1,6 +1,6 @@
|
||||
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
@ -565,7 +565,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.encode(cp,i.split(""),e);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.encode(cp,new Buffer(i),e);
|
||||
var buf = cptable.utils.encode(cp,Buffer.from(i),e);
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -593,7 +593,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.decode(cp,s.join?s.join(""):s);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.decode(cp,new Buffer(i));
|
||||
var buf = cptable.utils.decode(cp,Buffer.from(i));
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -603,7 +603,7 @@ describe('entry conditions', function() {
|
||||
};
|
||||
describe('decode', function() {
|
||||
it('CP 1252 : sbcs', function() { chkde(1252,[0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); }); /* "foobar" */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, new Buffer([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* (" and smiley faces") */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, Buffer.from([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* (" and smiley faces") */
|
||||
it('CP 936 : dbcs', function() { chkde(936, [0xd5, 0xe2, 0xca, 0xc7, 0xd6, 0xd0, 0xce, 0xc4, 0xd7, 0xd6, 0xb7, 0xfb, 0xb2, 0xe2, 0xca, 0xd4]);}); /* "" */
|
||||
});
|
||||
});
|
||||
@ -754,7 +754,7 @@ describe('failures', function() {
|
||||
```json>package.json
|
||||
{
|
||||
"name": "codepage",
|
||||
"version": "1.12.0",
|
||||
"version": "1.13.0",
|
||||
"author": "SheetJS",
|
||||
"description": "pure-JS library to handle codepages",
|
||||
"keywords": [ "codepage", "iconv", "convert", "strings" ],
|
||||
@ -767,16 +767,16 @@ describe('failures', function() {
|
||||
"buffer": "false"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "~2.11.0",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"voc": "~1.0.0"
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"voc": "~1.1.0",
|
||||
"mocha": "~2.5.3",
|
||||
"blanket": "~1.2.3",
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"@types/commander": "^2.9.0",
|
||||
"@types/commander": "^2.12.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
@ -807,6 +807,8 @@ describe('failures', function() {
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"bin",
|
||||
"types/index.d.ts",
|
||||
"types/*.json",
|
||||
"cptable.js",
|
||||
"cputils.js",
|
||||
"dist/sbcs.full.js",
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -565,7 +565,7 @@ describe('entry conditions', function() +AHs
|
||||
var arr +AD0 cptable.utils.encode(cp,i.split(+ACIAIg),e)+ADs
|
||||
assert.deepEqual(str,arr)+ADs
|
||||
if(typeof Buffer +AD0APQA9 'undefined') return+ADs
|
||||
var buf +AD0 cptable.utils.encode(cp,new Buffer(i),e)+ADs
|
||||
var buf +AD0 cptable.utils.encode(cp,Buffer.from(i),e)+ADs
|
||||
assert.deepEqual(str,buf)+ADs
|
||||
+AH0AOw
|
||||
cptable.utils.cache.encache()+ADs
|
||||
@ -593,7 +593,7 @@ describe('entry conditions', function() +AHs
|
||||
var arr +AD0 cptable.utils.decode(cp,s.join?s.join(+ACIAIg):s)+ADs
|
||||
assert.deepEqual(str,arr)+ADs
|
||||
if(typeof Buffer +AD0APQA9 'undefined') return+ADs
|
||||
var buf +AD0 cptable.utils.decode(cp,new Buffer(i))+ADs
|
||||
var buf +AD0 cptable.utils.decode(cp,Buffer.from(i))+ADs
|
||||
assert.deepEqual(str,buf)+ADs
|
||||
+AH0AOw
|
||||
cptable.utils.cache.encache()+ADs
|
||||
@ -603,7 +603,7 @@ describe('entry conditions', function() +AHs
|
||||
+AH0AOw
|
||||
describe('decode', function() +AHs
|
||||
it('CP 1252 : sbcs', function() +AHs chkde(1252,+AFs-0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72+AF0)+ADs +AH0)+ADs /+ACo +ACI-foobar+ACI +ACo-/
|
||||
if(typeof Buffer +ACEAPQA9 'undefined') it('CP 708 : sbcs', function() +AHs chkde(708, new Buffer(+AFs-0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73+AF0))+ADs +AH0)+ADs /+ACo (+ACIGKg and +Bis smiley faces+ACI) +ACo-/
|
||||
if(typeof Buffer +ACEAPQA9 'undefined') it('CP 708 : sbcs', function() +AHs chkde(708, Buffer.from(+AFs-0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73+AF0))+ADs +AH0)+ADs /+ACo (+ACIGKg and +Bis smiley faces+ACI) +ACo-/
|
||||
it('CP 936 : dbcs', function() +AHs chkde(936, +AFs-0xd5, 0xe2, 0xca, 0xc7, 0xd6, 0xd0, 0xce, 0xc4, 0xd7, 0xd6, 0xb7, 0xfb, 0xb2, 0xe2, 0xca, 0xd4+AF0)+ADsAfQ)+ADs /+ACo +ACKP2WYvTi1lh1tXeyZtS4vVACI +ACo-/
|
||||
+AH0)+ADs
|
||||
+AH0)+ADs
|
||||
@ -754,7 +754,7 @@ describe('failures', function() +AHs
|
||||
+AGAAYABg-json+AD4-package.json
|
||||
+AHs
|
||||
+ACI-name+ACI: +ACI-codepage+ACI,
|
||||
+ACI-version+ACI: +ACI-1.12.0+ACI,
|
||||
+ACI-version+ACI: +ACI-1.13.0+ACI,
|
||||
+ACI-author+ACI: +ACI-SheetJS+ACI,
|
||||
+ACI-description+ACI: +ACI-pure-JS library to handle codepages+ACI,
|
||||
+ACI-keywords+ACI: +AFs +ACI-codepage+ACI, +ACI-iconv+ACI, +ACI-convert+ACI, +ACI-strings+ACI +AF0,
|
||||
@ -767,16 +767,16 @@ describe('failures', function() +AHs
|
||||
+ACI-buffer+ACI: +ACI-false+ACI
|
||||
+AH0,
|
||||
+ACI-dependencies+ACI: +AHs
|
||||
+ACI-commander+ACI: +ACIAfg-2.11.0+ACI,
|
||||
+ACI-exit-on-epipe+ACI: +ACIAfg-1.0.1+ACI,
|
||||
+ACI-voc+ACI: +ACIAfg-1.0.0+ACI
|
||||
+ACI-commander+ACI: +ACIAfg-2.14.1+ACI,
|
||||
+ACI-exit-on-epipe+ACI: +ACIAfg-1.0.1+ACI
|
||||
+AH0,
|
||||
+ACI-devDependencies+ACI: +AHs
|
||||
+ACI-voc+ACI: +ACIAfg-1.1.0+ACI,
|
||||
+ACI-mocha+ACI: +ACIAfg-2.5.3+ACI,
|
||||
+ACI-blanket+ACI: +ACIAfg-1.2.3+ACI,
|
||||
+ACIAQA-sheetjs/uglify-js+ACI: +ACIAfg-2.7.3+ACI,
|
||||
+ACIAQA-types/node+ACI: +ACIAXg-8.0.7+ACI,
|
||||
+ACIAQA-types/commander+ACI: +ACIAXg-2.9.0+ACI,
|
||||
+ACIAQA-types/commander+ACI: +ACIAXg-2.12.0+ACI,
|
||||
+ACI-dtslint+ACI: +ACIAXg-0.1.2+ACI,
|
||||
+ACI-typescript+ACI: +ACI-2.2.0+ACI
|
||||
+AH0,
|
||||
@ -807,6 +807,8 @@ describe('failures', function() +AHs
|
||||
+ACI-LICENSE+ACI,
|
||||
+ACI-README.md+ACI,
|
||||
+ACI-bin+ACI,
|
||||
+ACI-types/index.d.ts+ACI,
|
||||
+ACI-types/+ACo.json+ACI,
|
||||
+ACI-cptable.js+ACI,
|
||||
+ACI-cputils.js+ACI,
|
||||
+ACI-dist/sbcs.full.js+ACI,
|
||||
|
@ -565,7 +565,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.encode(cp,i.split(""),e);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.encode(cp,new Buffer(i),e);
|
||||
var buf = cptable.utils.encode(cp,Buffer.from(i),e);
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -593,7 +593,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.decode(cp,s.join?s.join(""):s);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.decode(cp,new Buffer(i));
|
||||
var buf = cptable.utils.decode(cp,Buffer.from(i));
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -603,7 +603,7 @@ describe('entry conditions', function() {
|
||||
};
|
||||
describe('decode', function() {
|
||||
it('CP 1252 : sbcs', function() { chkde(1252,[0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); }); /* "foobar" */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, new Buffer([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, Buffer.from([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
it('CP 936 : dbcs', function() { chkde(936, [0xd5, 0xe2, 0xca, 0xc7, 0xd6, 0xd0, 0xce, 0xc4, 0xd7, 0xd6, 0xb7, 0xfb, 0xb2, 0xe2, 0xca, 0xd4]);}); /* "这是中文字符测试" */
|
||||
});
|
||||
});
|
||||
@ -754,7 +754,7 @@ describe('failures', function() {
|
||||
```json>package.json
|
||||
{
|
||||
"name": "codepage",
|
||||
"version": "1.12.0",
|
||||
"version": "1.13.0",
|
||||
"author": "SheetJS",
|
||||
"description": "pure-JS library to handle codepages",
|
||||
"keywords": [ "codepage", "iconv", "convert", "strings" ],
|
||||
@ -767,16 +767,16 @@ describe('failures', function() {
|
||||
"buffer": "false"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "~2.11.0",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
"voc": "~1.0.0"
|
||||
"commander": "~2.14.1",
|
||||
"exit-on-epipe": "~1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"voc": "~1.1.0",
|
||||
"mocha": "~2.5.3",
|
||||
"blanket": "~1.2.3",
|
||||
"@sheetjs/uglify-js": "~2.7.3",
|
||||
"@types/node": "^8.0.7",
|
||||
"@types/commander": "^2.9.0",
|
||||
"@types/commander": "^2.12.0",
|
||||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
@ -807,6 +807,8 @@ describe('failures', function() {
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"bin",
|
||||
"types/index.d.ts",
|
||||
"types/*.json",
|
||||
"cptable.js",
|
||||
"cputils.js",
|
||||
"dist/sbcs.full.js",
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a .<(+|&!$*);-/,%_>?`:#@'=\"abcdefghijklmnopqr~stuvwxyz^[]{ABCDEFGHI}JKLMNOPQR\\STUVWXYZ0123456789", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a [.<(+!&]$*);^-/,%_>?`:#@'=\"abcdefghijklmnopqr~stuvwxyz|{ABCDEFGHI}JKLMNOPQR\\STUVWXYZ0123456789", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
/+ACo cptable.js (C) 2013-present SheetJS -- http://sheetjs.com +ACo-/
|
||||
/+ACo-jshint -W100 +ACo-/
|
||||
var cptable +AD0 +AHs-version:+ACI-1.12.0+ACIAfQA7
|
||||
var cptable +AD0 +AHs-version:+ACI-1.13.0+ACIAfQA7
|
||||
cptable+AFs-37+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AJwAXA-t+AIYAfwCXAI0AjgBc-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AJ0AhQBc-b+AIcAXA-u0018+AFw-u0019+AJIAjwBc-u001c+AFw-u001d+AFw-u001e+AFw-u001f+AIAAgQCCAIMAhABc-n+AFw-u0017+AFw-u001b+AIgAiQCKAIsAjABc-u0005+AFw-u0006+AFw-u0007+AJAAkQBc-u0016+AJMAlACVAJYAXA-u0004+AJgAmQCaAJsAXA-u0014+AFw-u0015+AJ4AXA-u001a +AKAA4gDkAOAA4QDjAOUA5wDxAKI.+ADw(+-+AHwAJgDpAOoA6wDoAO0A7gDvAOwA3wAhACQAKg)+ADsArA--/+AMIAxADAAMEAwwDFAMcA0QCm,+ACUAXwA+?+APgAyQDKAMsAyADNAM4AzwDMAGA:+ACMAQA'+AD0AXAAiANg-abcdefghi+AKsAuwDwAP0A/gCxALA-jklmnopqr+AKoAugDmALgAxgCkALUAfg-stuvwxyz+AKEAvwDQAN0A3gCuAF4AowClALcAqQCnALYAvAC9AL4AWwBdAK8AqAC0ANcAew-ABCDEFGHI+AK0A9AD2APIA8wD1AH0-JKLMNOPQR+ALkA+wD8APkA+gD/AFwAXAD3-STUVWXYZ+ALIA1ADWANIA0wDV-0123456789+ALMA2wDcANkA2gCfACI, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
|
||||
cptable+AFs-437+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AFw-u0004+AFw-u0005+AFw-u0006+AFw-u0007+AFw-b+AFw-t+AFw-n+AFw-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AFw-u0014+AFw-u0015+AFw-u0016+AFw-u0017+AFw-u0018+AFw-u0019+AFw-u001a+AFw-u001b+AFw-u001c+AFw-u001d+AFw-u001e+AFw-u001f +ACEAXAAiACMAJAAlACY'()+ACoAKw,-./0123456789:+ADsAPAA9AD4?+AEA-ABCDEFGHIJKLMNOPQRSTUVWXYZ+AFsAXABcAF0AXgBfAGA-abcdefghijklmnopqrstuvwxyz+AHsAfAB9AH4AfwDHAPwA6QDiAOQA4ADlAOcA6gDrAOgA7wDuAOwAxADFAMkA5gDGAPQA9gDyAPsA+QD/ANYA3ACiAKMApSCnAZIA4QDtAPMA+gDxANEAqgC6AL8jEACsAL0AvAChAKsAuyWRJZIlkyUCJSQlYSViJVYlVSVjJVElVyVdJVwlWyUQJRQlNCUsJRwlACU8JV4lXyVaJVQlaSVmJWAlUCVsJWclaCVkJWUlWSVYJVIlUyVrJWolGCUMJYglhCWMJZAlgAOxAN8DkwPAA6MDwwC1A8QDpgOYA6kDtCIeA8YDtSIpImEAsSJlImQjICMhAPciSACwIhkAtyIaIH8AsiWgAKAAIg, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
|
||||
cptable+AFs-500+AF0 +AD0 (function()+AHs var d +AD0 +ACIAXA-u0000+AFw-u0001+AFw-u0002+AFw-u0003+AJwAXA-t+AIYAfwCXAI0AjgBc-u000b+AFw-f+AFw-r+AFw-u000e+AFw-u000f+AFw-u0010+AFw-u0011+AFw-u0012+AFw-u0013+AJ0AhQBc-b+AIcAXA-u0018+AFw-u0019+AJIAjwBc-u001c+AFw-u001d+AFw-u001e+AFw-u001f+AIAAgQCCAIMAhABc-n+AFw-u0017+AFw-u001b+AIgAiQCKAIsAjABc-u0005+AFw-u0006+AFw-u0007+AJAAkQBc-u0016+AJMAlACVAJYAXA-u0004+AJgAmQCaAJsAXA-u0014+AFw-u0015+AJ4AXA-u001a +AKAA4gDkAOAA4QDjAOUA5wDxAFs.+ADw(+-+ACEAJgDpAOoA6wDoAO0A7gDvAOwA3wBdACQAKg)+ADsAXg--/+AMIAxADAAMEAwwDFAMcA0QCm,+ACUAXwA+?+APgAyQDKAMsAyADNAM4AzwDMAGA:+ACMAQA'+AD0AXAAiANg-abcdefghi+AKsAuwDwAP0A/gCxALA-jklmnopqr+AKoAugDmALgAxgCkALUAfg-stuvwxyz+AKEAvwDQAN0A3gCuAKIAowClALcAqQCnALYAvAC9AL4ArAB8AK8AqAC0ANcAew-ABCDEFGHI+AK0A9AD2APIA8wD1AH0-JKLMNOPQR+ALkA+wD8APkA+gD/AFwAXAD3-STUVWXYZ+ALIA1ADWANIA0wDV-0123456789+ALMA2wDcANkA2gCfACI, D +AD0 +AFsAXQ, e +AD0 +AHsAfQA7 for(var i+AD0-0+ADs-i+ACEAPQ-d.length+ADsAKwAr-i) +AHs if(d.charCodeAt(i) +ACEAPQA9 0xFFFD) e+AFs-d.charAt(i)+AF0 +AD0 i+ADs D+AFs-i+AF0 +AD0 d.charAt(i)+ADs +AH0 return +AHsAIg-enc+ACI: e, +ACI-dec+ACI: D +AH0AOw +AH0)()+ADs
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* cptable.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
@ -41,9 +41,14 @@
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -58,10 +63,10 @@
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -76,7 +81,7 @@
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -86,7 +91,7 @@
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -94,7 +99,7 @@
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -116,7 +121,7 @@
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -125,7 +130,7 @@
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -159,7 +164,7 @@
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -168,7 +173,7 @@
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -194,7 +199,7 @@
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -219,7 +224,7 @@
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -298,7 +303,7 @@
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -310,7 +315,7 @@
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -332,7 +337,7 @@
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -340,7 +345,7 @@
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -41,9 +41,14 @@
|
||||
|
||||
var has+AF8-buf +AD0 (typeof Buffer +ACEAPQA9 'undefined')+ADs
|
||||
if(has+AF8-buf) +AHs
|
||||
var mdl +AD0 1024, mdb +AD0 new Buffer(mdl)+ADs
|
||||
// +ACQ-FlowIgnore
|
||||
if(+ACE-Buffer.from) Buffer.from +AD0 function(buf, enc) +AHs return (enc) ? new Buffer(buf, enc) : new Buffer(buf)+ADs +AH0AOw
|
||||
// +ACQ-FlowIgnore
|
||||
if(+ACE-Buffer.allocUnsafe) Buffer.allocUnsafe +AD0 function(n) +AHs return new Buffer(n)+ADs +AH0AOw
|
||||
|
||||
var mdl +AD0 1024, mdb +AD0 Buffer.allocUnsafe(mdl)+ADs
|
||||
var make+AF8-EE +AD0 function make+AF8-EE(E)+AHs
|
||||
var EE +AD0 new Buffer(65536)+ADs
|
||||
var EE +AD0 Buffer.allocUnsafe(65536)+ADs
|
||||
for(var i +AD0 0+ADs i +ADw 65536+ADsAKwAr-i) EE+AFs-i+AF0 +AD0 0+ADs
|
||||
var keys +AD0 Object.keys(E), len +AD0 keys.length+ADs
|
||||
for(var ee +AD0 0, e +AD0 keys+AFs-ee+AF0AOw ee +ADw len+ADs +-+-ee) +AHs
|
||||
@ -58,10 +63,10 @@
|
||||
var len +AD0 data.length+ADs
|
||||
var out, i+AD0-0, j+AD0-0, D+AD0-0, w+AD0-0+ADs
|
||||
if(typeof data +AD0APQA9 'string') +AHs
|
||||
out +AD0 new Buffer(len)+ADs
|
||||
out +AD0 Buffer.allocUnsafe(len)+ADs
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i) out+AFs-i+AF0 +AD0 EE+AFs-data.charCodeAt(i)+AF0AOw
|
||||
+AH0 else if(Buffer.isBuffer(data)) +AHs
|
||||
out +AD0 new Buffer(2+ACo-len)+ADs
|
||||
out +AD0 Buffer.allocUnsafe(2+ACo-len)+ADs
|
||||
j +AD0 0+ADs
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i) +AHs
|
||||
D +AD0 data+AFs-i+AF0AOw
|
||||
@ -76,7 +81,7 @@
|
||||
+AH0
|
||||
out +AD0 out.slice(0,j)+ADs
|
||||
+AH0 else +AHs
|
||||
out +AD0 new Buffer(len)+ADs
|
||||
out +AD0 Buffer.allocUnsafe(len)+ADs
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i) out+AFs-i+AF0 +AD0 EE+AFs-data+AFs-i+AF0.charCodeAt(0)+AF0AOw
|
||||
+AH0
|
||||
if(+ACE-ofmt +AHwAfA ofmt +AD0APQA9 'buf') return out+ADs
|
||||
@ -86,7 +91,7 @@
|
||||
+AH0AOw
|
||||
var sbcs+AF8-decode +AD0 function make+AF8-sbcs+AF8-decode(cp) +AHs
|
||||
var D +AD0 cpt+AFs-cp+AF0.dec+ADs
|
||||
var DD +AD0 new Buffer(131072), d+AD0-0, c+AD0AIgAiADs
|
||||
var DD +AD0 Buffer.allocUnsafe(131072), d+AD0-0, c+AD0AIgAiADs
|
||||
for(d+AD0-0+ADs-d+ADw-D.length+ADsAKwAr-d) +AHs
|
||||
if(+ACE(c+AD0-D+AFs-d+AF0)) continue+ADs
|
||||
var w +AD0 c.charCodeAt(0)+ADs
|
||||
@ -94,7 +99,7 @@
|
||||
+AH0
|
||||
return function sbcs+AF8-d(data) +AHs
|
||||
var len +AD0 data.length, i+AD0-0, j+AD0-0+ADs
|
||||
if(2 +ACo len +AD4 mdl) +AHs mdl +AD0 2 +ACo len+ADs mdb +AD0 new Buffer(mdl)+ADs +AH0
|
||||
if(2 +ACo len +AD4 mdl) +AHs mdl +AD0 2 +ACo len+ADs mdb +AD0 Buffer.allocUnsafe(mdl)+ADs +AH0
|
||||
if(Buffer.isBuffer(data)) +AHs
|
||||
for(i +AD0 0+ADs i +ADw len+ADs i+-+-) +AHs
|
||||
j +AD0 2+ACo-data+AFs-i+AF0AOw
|
||||
@ -116,7 +121,7 @@
|
||||
+AH0AOw
|
||||
var dbcs+AF8-encode +AD0 function make+AF8-dbcs+AF8-encode(cp) +AHs
|
||||
var E +AD0 cpt+AFs-cp+AF0.enc+ADs
|
||||
var EE +AD0 new Buffer(131072)+ADs
|
||||
var EE +AD0 Buffer.allocUnsafe(131072)+ADs
|
||||
for(var i +AD0 0+ADs i +ADw 131072+ADs +-+-i) EE+AFs-i+AF0 +AD0 0+ADs
|
||||
var keys +AD0 Object.keys(E)+ADs
|
||||
for(var ee +AD0 0, e +AD0 keys+AFs-ee+AF0AOw ee +ADw keys.length+ADs +-+-ee) +AHs
|
||||
@ -125,7 +130,7 @@
|
||||
EE+AFs-2+ACo-f+AF0 +AD0 E+AFs-e+AF0 +ACY 255+ADs EE+AFs-2+ACo-f+-1+AF0 +AD0 E+AFs-e+AF0APgA+-8+ADs
|
||||
+AH0
|
||||
return function dbcs+AF8-e(data, ofmt) +AHs
|
||||
var len +AD0 data.length, out +AD0 new Buffer(2+ACo-len), i+AD0-0, j+AD0-0, jj+AD0-0, k+AD0-0, D+AD0-0+ADs
|
||||
var len +AD0 data.length, out +AD0 Buffer.allocUnsafe(2+ACo-len), i+AD0-0, j+AD0-0, jj+AD0-0, k+AD0-0, D+AD0-0+ADs
|
||||
if(typeof data +AD0APQA9 'string') +AHs
|
||||
for(i +AD0 k +AD0 0+ADs i +ADw len+ADs +-+-i) +AHs
|
||||
j +AD0 data.charCodeAt(i)+ACo-2+ADs
|
||||
@ -159,7 +164,7 @@
|
||||
+AH0AOw
|
||||
var dbcs+AF8-decode +AD0 function make+AF8-dbcs+AF8-decode(cp) +AHs
|
||||
var D +AD0 cpt+AFs-cp+AF0.dec+ADs
|
||||
var DD +AD0 new Buffer(131072), d+AD0-0, c, w+AD0-0, j+AD0-0, i+AD0-0+ADs
|
||||
var DD +AD0 Buffer.allocUnsafe(131072), d+AD0-0, c, w+AD0-0, j+AD0-0, i+AD0-0+ADs
|
||||
for(i +AD0 0+ADs i +ADw 65536+ADs +-+-i) +AHs DD+AFs-2+ACo-i+AF0 +AD0 0xFF+ADs DD+AFs-2+ACo-i+-1+AF0 +AD0 0xFD+ADsAfQ
|
||||
for(d +AD0 0+ADs d +ADw D.length+ADs +-+-d) +AHs
|
||||
if(+ACE(c+AD0-D+AFs-d+AF0)) continue+ADs
|
||||
@ -168,7 +173,7 @@
|
||||
DD+AFs-j+AF0 +AD0 w+ACY-255+ADs DD+AFs-j+-1+AF0 +AD0 w+AD4APg-8+ADs
|
||||
+AH0
|
||||
return function dbcs+AF8-d(data) +AHs
|
||||
var len +AD0 data.length, out +AD0 new Buffer(2+ACo-len), i+AD0-0, j+AD0-0, k+AD0-0+ADs
|
||||
var len +AD0 data.length, out +AD0 Buffer.allocUnsafe(2+ACo-len), i+AD0-0, j+AD0-0, k+AD0-0+ADs
|
||||
if(Buffer.isBuffer(data)) +AHs
|
||||
for(i +AD0 0+ADs i +ADw len+ADs i+-+-) +AHs
|
||||
j +AD0 2+ACo-data+AFs-i+AF0AOw
|
||||
@ -194,7 +199,7 @@
|
||||
magic+AF8-decode+AFs-65001+AF0 +AD0 function utf8+AF8-d(data) +AHs
|
||||
if(typeof data +AD0APQA9 +ACI-string+ACI) return utf8+AF8-d(data.split(+ACIAIg).map(cca))+ADs
|
||||
var len +AD0 data.length, w +AD0 0, ww +AD0 0+ADs
|
||||
if(4 +ACo len +AD4 mdl) +AHs mdl +AD0 4 +ACo len+ADs mdb +AD0 new Buffer(mdl)+ADs +AH0
|
||||
if(4 +ACo len +AD4 mdl) +AHs mdl +AD0 4 +ACo len+ADs mdb +AD0 Buffer.allocUnsafe(mdl)+ADs +AH0
|
||||
var i +AD0 0+ADs
|
||||
if(len +AD4APQ 3 +ACYAJg data+AFs-0+AF0 +AD0APQ 0xEF) if(data+AFs-1+AF0 +AD0APQ 0xBB +ACYAJg data+AFs-2+AF0 +AD0APQ 0xBF) i +AD0 3+ADs
|
||||
for(var j +AD0 1, k +AD0 0, D +AD0 0+ADs i +ADw len+ADs i+-+AD0-j) +AHs
|
||||
@ -219,7 +224,7 @@
|
||||
+AH0
|
||||
var len +AD0 data.length, w +AD0 0, ww +AD0 0, j +AD0 0+ADs
|
||||
var direct +AD0 typeof data +AD0APQA9 +ACI-string+ACIAOw
|
||||
if(4 +ACo len +AD4 mdl) +AHs mdl +AD0 4 +ACo len+ADs mdb +AD0 new Buffer(mdl)+ADs +AH0
|
||||
if(4 +ACo len +AD4 mdl) +AHs mdl +AD0 4 +ACo len+ADs mdb +AD0 Buffer.allocUnsafe(mdl)+ADs +AH0
|
||||
for(var i +AD0 0+ADs i +ADw len+ADs +-+-i) +AHs
|
||||
w +AD0 direct ? data.charCodeAt(i) : data+AFs-i+AF0.charCodeAt(0)+ADs
|
||||
if(w +ADwAPQ 0x007F) mdb+AFs-j+-+-+AF0 +AD0 w+ADs
|
||||
@ -298,7 +303,7 @@
|
||||
if(cpecache+AFs-cp+AF0) +AHs last+AF8-enc +AD0 cpecache+AFs-last+AF8-cp+AD0-cp+AF0AOw return last+AF8-enc(data, ofmt)+ADs +AH0
|
||||
if(has+AF8-buf +ACYAJg Buffer.isBuffer(data)) data +AD0 data.toString('utf8')+ADs
|
||||
var len +AD0 data.length+ADs
|
||||
var out +AD0 has+AF8-buf ? new Buffer(4+ACo-len) : +AFsAXQ, w+AD0-0, i+AD0-0, j +AD0 0, ww+AD0-0+ADs
|
||||
var out +AD0 has+AF8-buf ? Buffer.allocUnsafe(4+ACo-len) : +AFsAXQ, w+AD0-0, i+AD0-0, j +AD0 0, ww+AD0-0+ADs
|
||||
var C +AD0 cpt+AFs-cp+AF0, E, M +AD0 +ACIAIgA7
|
||||
var isstr +AD0 typeof data +AD0APQA9 'string'+ADs
|
||||
if(C +ACYAJg (E+AD0-C.enc)) for(i +AD0 0+ADs i +ADw len+ADs +-+-i, +-+-j) +AHs
|
||||
@ -310,7 +315,7 @@
|
||||
+AH0
|
||||
else if((M+AD0-magic+AFs-cp+AF0)) switch(M) +AHs
|
||||
case +ACI-utf8+ACI:
|
||||
if(has+AF8-buf +ACYAJg isstr) +AHs out +AD0 new Buffer(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
if(has+AF8-buf +ACYAJg isstr) +AHs out +AD0 Buffer.from(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i, +-+-j) +AHs
|
||||
w +AD0 isstr ? data.charCodeAt(i) : data+AFs-i+AF0.charCodeAt(0)+ADs
|
||||
if(w +ADwAPQ 0x007F) out+AFs-j+AF0 +AD0 w+ADs
|
||||
@ -332,7 +337,7 @@
|
||||
+AH0
|
||||
break+ADs
|
||||
case +ACI-ascii+ACI:
|
||||
if(has+AF8-buf +ACYAJg typeof data +AD0APQA9 +ACI-string+ACI) +AHs out +AD0 new Buffer(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
if(has+AF8-buf +ACYAJg typeof data +AD0APQA9 +ACI-string+ACI) +AHs out +AD0 Buffer.from(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i, +-+-j) +AHs
|
||||
w +AD0 isstr ? data.charCodeAt(i) : data+AFs-i+AF0.charCodeAt(0)+ADs
|
||||
if(w +ADwAPQ 0x007F) out+AFs-j+AF0 +AD0 w+ADs
|
||||
@ -340,7 +345,7 @@
|
||||
+AH0
|
||||
break+ADs
|
||||
case +ACI-utf16le+ACI:
|
||||
if(has+AF8-buf +ACYAJg typeof data +AD0APQA9 +ACI-string+ACI) +AHs out +AD0 new Buffer(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
if(has+AF8-buf +ACYAJg typeof data +AD0APQA9 +ACI-string+ACI) +AHs out +AD0 Buffer.from(data, M)+ADs j +AD0 out.length+ADs break+ADs +AH0
|
||||
for(i +AD0 0+ADs i +ADw len+ADs +-+-i) +AHs
|
||||
w +AD0 isstr ? data.charCodeAt(i) : data+AFs-i+AF0.charCodeAt(0)+ADs
|
||||
out+AFs-j+-+-+AF0 +AD0 w+ACY-255+ADs
|
||||
|
@ -41,9 +41,14 @@
|
||||
|
||||
var has_buf = (typeof Buffer !== 'undefined');
|
||||
if(has_buf) {
|
||||
var mdl = 1024, mdb = new Buffer(mdl);
|
||||
// $FlowIgnore
|
||||
if(!Buffer.from) Buffer.from = function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); };
|
||||
// $FlowIgnore
|
||||
if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
|
||||
|
||||
var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
|
||||
var make_EE = function make_EE(E){
|
||||
var EE = new Buffer(65536);
|
||||
var EE = Buffer.allocUnsafe(65536);
|
||||
for(var i = 0; i < 65536;++i) EE[i] = 0;
|
||||
var keys = Object.keys(E), len = keys.length;
|
||||
for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
|
||||
@ -58,10 +63,10 @@
|
||||
var len = data.length;
|
||||
var out, i=0, j=0, D=0, w=0;
|
||||
if(typeof data === 'string') {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
|
||||
} else if(Buffer.isBuffer(data)) {
|
||||
out = new Buffer(2*len);
|
||||
out = Buffer.allocUnsafe(2*len);
|
||||
j = 0;
|
||||
for(i = 0; i < len; ++i) {
|
||||
D = data[i];
|
||||
@ -76,7 +81,7 @@
|
||||
}
|
||||
out = out.slice(0,j);
|
||||
} else {
|
||||
out = new Buffer(len);
|
||||
out = Buffer.allocUnsafe(len);
|
||||
for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
|
||||
}
|
||||
if(!ofmt || ofmt === 'buf') return out;
|
||||
@ -86,7 +91,7 @@
|
||||
};
|
||||
var sbcs_decode = function make_sbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c="";
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c="";
|
||||
for(d=0;d<D.length;++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
var w = c.charCodeAt(0);
|
||||
@ -94,7 +99,7 @@
|
||||
}
|
||||
return function sbcs_d(data) {
|
||||
var len = data.length, i=0, j=0;
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = new Buffer(mdl); }
|
||||
if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -116,7 +121,7 @@
|
||||
};
|
||||
var dbcs_encode = function make_dbcs_encode(cp) {
|
||||
var E = cpt[cp].enc;
|
||||
var EE = new Buffer(131072);
|
||||
var EE = Buffer.allocUnsafe(131072);
|
||||
for(var i = 0; i < 131072; ++i) EE[i] = 0;
|
||||
var keys = Object.keys(E);
|
||||
for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
|
||||
@ -125,7 +130,7 @@
|
||||
EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
|
||||
}
|
||||
return function dbcs_e(data, ofmt) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
|
||||
if(typeof data === 'string') {
|
||||
for(i = k = 0; i < len; ++i) {
|
||||
j = data.charCodeAt(i)*2;
|
||||
@ -159,7 +164,7 @@
|
||||
};
|
||||
var dbcs_decode = function make_dbcs_decode(cp) {
|
||||
var D = cpt[cp].dec;
|
||||
var DD = new Buffer(131072), d=0, c, w=0, j=0, i=0;
|
||||
var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
|
||||
for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
|
||||
for(d = 0; d < D.length; ++d) {
|
||||
if(!(c=D[d])) continue;
|
||||
@ -168,7 +173,7 @@
|
||||
DD[j] = w&255; DD[j+1] = w>>8;
|
||||
}
|
||||
return function dbcs_d(data) {
|
||||
var len = data.length, out = new Buffer(2*len), i=0, j=0, k=0;
|
||||
var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
|
||||
if(Buffer.isBuffer(data)) {
|
||||
for(i = 0; i < len; i++) {
|
||||
j = 2*data[i];
|
||||
@ -194,7 +199,7 @@
|
||||
magic_decode[65001] = function utf8_d(data) {
|
||||
if(typeof data === "string") return utf8_d(data.split("").map(cca));
|
||||
var len = data.length, w = 0, ww = 0;
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
var i = 0;
|
||||
if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
|
||||
for(var j = 1, k = 0, D = 0; i < len; i+=j) {
|
||||
@ -219,7 +224,7 @@
|
||||
}
|
||||
var len = data.length, w = 0, ww = 0, j = 0;
|
||||
var direct = typeof data === "string";
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = new Buffer(mdl); }
|
||||
if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
|
||||
for(var i = 0; i < len; ++i) {
|
||||
w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) mdb[j++] = w;
|
||||
@ -298,7 +303,7 @@
|
||||
if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
|
||||
if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
|
||||
var len = data.length;
|
||||
var out = has_buf ? new Buffer(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
|
||||
var C = cpt[cp], E, M = "";
|
||||
var isstr = typeof data === 'string';
|
||||
if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
|
||||
@ -310,7 +315,7 @@
|
||||
}
|
||||
else if((M=magic[cp])) switch(M) {
|
||||
case "utf8":
|
||||
if(has_buf && isstr) { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && isstr) { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -332,7 +337,7 @@
|
||||
}
|
||||
break;
|
||||
case "ascii":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i, ++j) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
if(w <= 0x007F) out[j] = w;
|
||||
@ -340,7 +345,7 @@
|
||||
}
|
||||
break;
|
||||
case "utf16le":
|
||||
if(has_buf && typeof data === "string") { out = new Buffer(data, M); j = out.length; break; }
|
||||
if(has_buf && typeof data === "string") { out = Buffer.from(data, M); j = out.length; break; }
|
||||
for(i = 0; i < len; ++i) {
|
||||
w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
|
||||
out[j++] = w&255;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codepage",
|
||||
"version": "1.12.2",
|
||||
"version": "1.13.0",
|
||||
"author": "SheetJS",
|
||||
"description": "pure-JS library to handle codepages",
|
||||
"keywords": [ "codepage", "iconv", "convert", "strings" ],
|
||||
|
2
sbcs.js
2
sbcs.js
@ -1,6 +1,6 @@
|
||||
/* sbcs.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/*jshint -W100 */
|
||||
var cptable = {version:"1.12.0"};
|
||||
var cptable = {version:"1.13.0"};
|
||||
cptable[37] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
cptable[500] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHIôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
|
6
test.js
6
test.js
@ -97,7 +97,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.encode(cp,i.split(""),e);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.encode(cp,new Buffer(i),e);
|
||||
var buf = cptable.utils.encode(cp,Buffer.from(i),e);
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -125,7 +125,7 @@ describe('entry conditions', function() {
|
||||
var arr = cptable.utils.decode(cp,s.join?s.join(""):s);
|
||||
assert.deepEqual(str,arr);
|
||||
if(typeof Buffer === 'undefined') return;
|
||||
var buf = cptable.utils.decode(cp,new Buffer(i));
|
||||
var buf = cptable.utils.decode(cp,Buffer.from(i));
|
||||
assert.deepEqual(str,buf);
|
||||
};
|
||||
cptable.utils.cache.encache();
|
||||
@ -135,7 +135,7 @@ describe('entry conditions', function() {
|
||||
};
|
||||
describe('decode', function() {
|
||||
it('CP 1252 : sbcs', function() { chkde(1252,[0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); }); /* "foobar" */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, new Buffer([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
if(typeof Buffer !== 'undefined') it('CP 708 : sbcs', function() { chkde(708, Buffer.from([0xca, 0x20, 0x61, 0x6e, 0x64, 0x20, 0xcb, 0x20, 0x73, 0x6d, 0x69, 0x6c, 0x65, 0x79, 0x20, 0x66, 0x61, 0x63, 0x65, 0x73])); }); /* ("ت and ث smiley faces") */
|
||||
it('CP 936 : dbcs', function() { chkde(936, [0xd5, 0xe2, 0xca, 0xc7, 0xd6, 0xd0, 0xce, 0xc4, 0xd7, 0xd6, 0xb7, 0xfb, 0xb2, 0xe2, 0xca, 0xd4]);}); /* "这是中文字符测试" */
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user