xiejun
2023-08-23 205056bc17023dd44e6d262cfe78b6e146ee2f20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var current_codepage = 1200, current_cptable;
if(typeof module !== "undefined" && typeof require !== 'undefined') {
    if(typeof cptable === 'undefined') cptable = require('./dist/cpexcel');
    current_cptable = cptable[current_codepage];
}
function reset_cp() { set_cp(1200); }
var set_cp = function(cp) { current_codepage = cp; };
 
function char_codes(data) { var o = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }
var debom_xml = function(data) { return data; };
 
var _getchar = function _gc1(x) { return String.fromCharCode(x); };
if(typeof cptable !== 'undefined') {
    set_cp = function(cp) { current_codepage = cp; current_cptable = cptable[cp]; };
    debom_xml = function(data) {
        if(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return cptable.utils.decode(1200, char_codes(data.substr(2))); }
        return data;
    };
    _getchar = function _gc2(x) {
        if(current_codepage === 1200) return String.fromCharCode(x);
        return cptable.utils.decode(current_codepage, [x&255,x>>8])[0];
    };
}