ludc
2023-08-24 56c45e1f4be85d6bbfb3a03437021c6742b32ad9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var parse_text_p = function(text, tag) {
    return utf8read(text.replace(/<text:s\/>/g," ").replace(/<[^>]*>/g,""));
};
 
var utf8read = function utf8reada(orig) {
    var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;
    while (i < orig.length) {
        c = orig.charCodeAt(i++);
        if (c < 128) { out += String.fromCharCode(c); continue; }
        d = orig.charCodeAt(i++);
        if (c>191 && c<224) { out += String.fromCharCode(((c & 31) << 6) | (d & 63)); continue; }
        e = orig.charCodeAt(i++);
        if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }
        f = orig.charCodeAt(i++);
        w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;
        out += String.fromCharCode(0xD800 + ((w>>>10)&1023));
        out += String.fromCharCode(0xDC00 + (w&1023));
    }
    return out;
};