dockerized_openAger/nodered/rootfs/data/node_modules/encoding-japanese/encoding.min.js

8 lines
222 KiB
JavaScript
Raw Permalink Normal View History

2020-10-17 16:42:50 +00:00
/*!
* encoding-japanese v1.0.30 - Convert or detect character encoding in JavaScript
* Copyright (c) 2013-2018 polygon planet <polygon.planet.aqua@gmail.com>
* https://github.com/polygonplanet/encoding.js
* @license MIT
*/
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Encoding=n()}}(function(){return function i(l,f,u){function g(e,n){if(!f[e]){if(!l[e]){var t="function"==typeof require&&require;if(!n&&t)return t(e,!0);if(h)return h(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=f[e]={exports:{}};l[e][0].call(o.exports,function(n){return g(l[e][1][n]||n)},o,o.exports,i,l,f,u)}return f[e].exports}for(var h="function"==typeof require&&require,n=0;n<u.length;n++)g(u[n]);return g}({1:[function(n,e,t){var h=n("./util"),i=n("./encoding-table"),a=Object.prototype.hasOwnProperty;t.UNKNOWN_CHARACTER=63;var r=t.HAS_TYPED="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array,o=!1,l=!1;try{"a"===String.fromCharCode.apply(null,[97])&&(o=!0)}catch(n){}if(r)try{"a"===String.fromCharCode.apply(null,new Uint8Array([97]))&&(l=!0)}catch(n){}t.CAN_CHARCODE_APPLY=o,t.CAN_CHARCODE_APPLY_TYPED=l,t.APPLY_BUFFER_SIZE=65533,t.APPLY_BUFFER_SIZE_OK=null;var g=t.EncodingNames={UTF32:{order:0},UTF32BE:{alias:["UCS4"]},UTF32LE:null,UTF16:{order:1},UTF16BE:{alias:["UCS2"]},UTF16LE:null,BINARY:{order:2},ASCII:{order:3,alias:["ISO646","CP367"]},JIS:{order:4,alias:["ISO2022JP"]},UTF8:{order:5},EUCJP:{order:6},SJIS:{order:7,alias:["CP932","MSKANJI","WINDOWS31J"]},UNICODE:{order:8}},T={};t.EncodingOrders=function(){for(var n,e,t,r,o=T,i=h.getKeys(g),l=[],f=0,u=i.length;f<u;f++)if(o[n=i[f]]=n,null!=(e=g[n])&&(void 0!==e.order&&(l[l.length]=n),e.alias))for(t=0,r=e.alias.length;t<r;t++)o[e.alias[t]]=n;return l.sort(function(n,e){return g[n].order-g[e].order}),l}(),t.init_JIS_TO_UTF8_TABLE=function(){if(null===i.JIS_TO_UTF8_TABLE){i.JIS_TO_UTF8_TABLE={};for(var n,e,t=h.getKeys(i.UTF8_TO_JIS_TABLE),r=0,o=t.length;r<o;r++)n=t[r],95<(e=i.UTF8_TO_JIS_TABLE[n])&&(i.JIS_TO_UTF8_TABLE[e]=0|n);for(i.JISX0212_TO_UTF8_TABLE={},o=(t=h.getKeys(i.UTF8_TO_JISX0212_TABLE)).length,r=0;r<o;r++)n=t[r],e=i.UTF8_TO_JISX0212_TABLE[n],i.JISX0212_TO_UTF8_TABLE[e]=0|n}},t.assignEncodingName=function(n){for(var e,t,r,o="",i=(""+n).toUpperCase().replace(/[^A-Z0-9]+/g,""),l=h.getKeys(T),f=l.length,u=0,g=0;g<f;g++){if((e=l[g])===i){o=e;break}for(t=e.length,r=u;r<t;r++)e.slice(0,r)!==i.slice(0,r)&&e.slice(-r)!==i.slice(-r)||(o=e,u=r)}return a.call(T,o)?T[o]:o}},{"./encoding-table":4,"./util":11}],2:[function(n,e,t){var a=n("./config"),h=n("./util"),u=n("./encoding-detect"),T=n("./encoding-table");function r(n){a.init_JIS_TO_UTF8_TABLE();for(var e,t,r,o,i,l,f,u=[],g=0,h=n&&n.length;g<h;g++)161<=(e=n[g])&&e<=223?(o=188|(r=e-64)>>6&3,i=128|63&r,u[u.length]=239,u[u.length]=255&o,u[u.length]=255&i):128<=e?(t=e<<1,(r=n[++g])<159?(t-=t<319?225:97,r-=126<r?32:31):(t-=t<319?224:96,r-=126),l=((t&=255)<<8)+r,void 0===(f=T.JIS_TO_UTF8_TABLE[l])?u[u.length]=a.UNKNOWN_CHARACTER:(f<65535||(u[u.length]=f>>16&255),u[u.length]=f>>8&255,u[u.length]=255&f)):u[u.length]=255&n[g];return u}function o(n){a.init_JIS_TO_UTF8_TABLE();for(var e,t,r,o,i,l,f=[],u=0,g=n&&n.length;u<g;u++)142===(e=n[u])?(r=188|(t=n[++u]-64)>>6&3,o=128|63&t,f[f.length]=239,f[f.length]=255&r,f[f.length]=255&o):143===e?(i=(n[++u]-128<<8)+(n[++u]-128),void 0===(l=T.JISX0212_TO_UTF8_TABLE[i])?f[f.length]=a.UNKNOWN_CHARACTER:(l<65535||(f[f.length]=l>>16&255),f[f.length]=l>>8&255,f[f.length]=255&l)):128<=e?(i=(e-128<<8)+(n[++u]-128),void 0===(l=T.JIS_TO_UTF8_TABLE[i])?f[f.length]=a.UNKNOWN_CHARACTER:(l<65535||(f[f.length]=l>>16&255),f[f.length]=l>>8&255,f[f.length]=255&l)):f[f.length]=255&n[u];return f}function i(n){a.init_JIS_TO_UTF8_TABLE();for(var e,t,r,o,i,l=[],f=0,u=0,g=n&&n.length;u<g;u++){for(;27===n[u];)if(36===n[u+1]&&66===n[u+2]||36===n[u+1]&&64===n[u+2]?f=1:40===n[u+1]&&73===n[u+2]?f=2:36===n[u+1]&&40===n[u+2]&&68===n[u+3]?(f=3,u++):f=0,void 0===n[u+=3])return l;1===f?(o=(n[u]<<8)+n[++u],void 0===(i=T.JIS_TO_UTF8_TABLE[o])?l[l.length]=a.UNKNOWN_CHARACTER:(i<65535||(l[l.length]=i>>16&255),l[l
//# sourceMappingURL=encoding.min.js.map