diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dcf3f84 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2014-2019 Polygon Planet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/encoding.js b/encoding.js index 3bbec1d..caf6cc7 100644 --- a/encoding.js +++ b/encoding.js @@ -1,5 +1,5 @@ /*! - * encoding-japanese v1.0.29 - Converts character encoding + * encoding-japanese v1.0.29 - Convert or detect character encoding in JavaScript * Copyright (c) 2013-2018 polygon planet * https://github.com/polygonplanet/encoding.js * @license MIT diff --git a/encoding.min.js b/encoding.min.js index 0ca1696..ece013c 100644 --- a/encoding.min.js +++ b/encoding.min.js @@ -1,8 +1,8 @@ /*! - * encoding-japanese v1.0.29 - Converts character encoding + * encoding-japanese v1.0.29 - Convert or detect character encoding in JavaScript * Copyright (c) 2013-2018 polygon planet * 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>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>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>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>16&255),l[l.length]=i>>8&255,l[l.length]=255&i)):2===f?(t=188|(e=n[u]+64)>>6&3,r=128|63&e,l[l.length]=239,l[l.length]=255&t,l[l.length]=255&r):3===f?(o=(n[u]<<8)+n[++u],void 0===(i=T.JISX0212_TO_UTF8_TABLE[o])?l[l.length]=a.UNKNOWN_CHARACTER:(i<65535||(l[l.length]=i>>16&255),l[l.length]=i>>8&255,l[l.length]=255&i)):l[l.length]=255&n[u]}return l}function l(n){for(var e,t,r,o,i,l=[],f=0,u=n&&n.length;f>8)?((t>>=1)<47?t+=113:t-=79,r+=95>=1)<=47?t+=112:t-=80,r+=126),l[l.length]=255&t,l[l.length]=255&r)):l[l.length]=255&n[f];return l}function f(n){for(var e,t,r,o=[],i=0,l=n&&n.length;i>8)-128&255,o[o.length]=(255&r)-128&255):(65536>8)-128&255,o[o.length]=(255&r)-128&255))):o[o.length]=255&n[i];return o}function g(n){for(var e,t,r,o=[],i=0,l=n&&n.length,f=0,u=[27,40,66,27,36,66,27,40,73,27,36,40,68];f>8&255,o[o.length]=255&r):(65536>8&255),o[o.length]=255&r));return 0!==i&&(o[o.length]=u[0],o[o.length]=u[1],o[o.length]=u[2]),o}function c(n){for(var e,t,r=[],o=0,i=n&&n.length;o>6&31,r[r.length]=128|63&e):e<65536?(r[r.length]=224|e>>12&15,r[r.length]=128|e>>6&63,r[r.length]=128|63&e):e<2097152&&(r[r.length]=240|e>>18&15,r[r.length]=128|e>>12&63,r[r.length]=128|e>>6&63,r[r.length]=128|63&e);return r}function s(n){for(var e,t,r,o=[],i=0,l=n&&n.length;i>4)&&e<=7?r=t:12===e||13===e?r=(31&t)<<6|63&n[i++]:14===e?r=(15&t)<<12|(63&n[i++])<<6|63&n[i++]:15===e&&(r=(7&t)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++]),r<=65535?o[o.length]=r:(r-=65536,o[o.length]=55296+(r>>10),o[o.length]=r%1024+56320);return o}function U(n,e){var t;if(e&&e.bom){var r,o,i=e.bom;h.isString(i)||(i="BE"),"B"===i.charAt(0).toUpperCase()?(r=[254,255],o=_(n)):(r=[255,254],o=E(n)),(t=[])[0]=r[0],t[1]=r[1];for(var l=0,f=o.length;l>8&255,t[t.length]=255&e);return t}function E(n){for(var e,t=[],r=0,o=n&&n.length;r>8&255);return t}function A(n){var e,t,r=[],o=0,i=n&&n.length;for(2<=i&&(254===n[0]&&255===n[1]||255===n[0]&&254===n[1])&&(o=2);o>=1)<47?e+=113:e-=79,t+=95>=1)<=47?e+=112:e-=80,t+=126),r[r.length]=255&e,r[r.length]=255&t):r[r.length]=2===o?n[i]+128&255:3===o?a.UNKNOWN_CHARACTER:255&n[i]}return r},t.JISToEUCJP=function(n){for(var e=[],t=0,r=n&&n.length,o=0;o>=1,e+=e<111?49:113,t-=223>=1,e+=e<=111?48:112,t-=2),r[r.length]=255&e,r[r.length]=255&t):r[r.length]=142===e?255&n[++i]:255&e;return r},t.SJISToUTF8=r,t.EUCJPToUTF8=o,t.JISToUTF8=i,t.UTF8ToSJIS=l,t.UTF8ToEUCJP=f,t.UTF8ToJIS=g,t.UNICODEToUTF8=c,t.UTF8ToUNICODE=s,t.UNICODEToUTF16=U,t.UNICODEToUTF16BE=_,t.UNICODEToUTF16LE=E,t.UTF16BEToUNICODE=A,t.UTF16LEToUNICODE=S,t.UTF16ToUNICODE=d,t.UTF16ToUTF16BE=function(n){for(var e,t,r=[],o=0,i=n&&n.length,l=!1,f=!0;o>4&15],r[r.length]=t[15&e]))}return u.codeToString_fast(r)},urlDecode:function(n){for(var e,t=[],r=0,o=n&&n.length;ri.APPLY_BUFFER_SIZE&&(i.APPLY_BUFFER_SIZE_OK=!0),t}catch(n){i.APPLY_BUFFER_SIZE_OK=!1}}return a(n)}function a(n){for(var e,t="",r=n&&n.length,o=0;oi.APPLY_BUFFER_SIZE&&(i.APPLY_BUFFER_SIZE_OK=!0);continue}catch(n){i.APPLY_BUFFER_SIZE_OK=!1}return T(n)}t+=l.apply(null,e)}return t}function T(n){for(var e="",t=n&&n.length,r=0;r>2],e[e.length]=c[(3&o)<<4],e[e.length]=U,e[e.length]=U;break}if(i=n[t++],t==r){e[e.length]=c[o>>2],e[e.length]=c[(3&o)<<4|(240&i)>>4],e[e.length]=c[(15&i)<<2],e[e.length]=U;break}l=n[t++],e[e.length]=c[o>>2],e[e.length]=c[(3&o)<<4|(240&i)>>4],e[e.length]=c[(15&i)<<2|(192&l)>>6],e[e.length]=c[63&l]}return h(e)},t.base64decode=function(n){var e,t,r,o,i,l,f;for(l=n&&n.length,i=0,f=[];i>4;do{if(61==(r=255&n.charCodeAt(i++)))return f;r=s[r]}while(i>2;do{if(61==(o=255&n.charCodeAt(i++)))return f;o=s[o]}while(i>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>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>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>16&255),l[l.length]=i>>8&255,l[l.length]=255&i)):2===f?(t=188|(e=n[u]+64)>>6&3,r=128|63&e,l[l.length]=239,l[l.length]=255&t,l[l.length]=255&r):3===f?(o=(n[u]<<8)+n[++u],void 0===(i=T.JISX0212_TO_UTF8_TABLE[o])?l[l.length]=a.UNKNOWN_CHARACTER:(i<65535||(l[l.length]=i>>16&255),l[l.length]=i>>8&255,l[l.length]=255&i)):l[l.length]=255&n[u]}return l}function l(n){for(var e,t,r,o,i,l=[],f=0,u=n&&n.length;f>8)?((t>>=1)<47?t+=113:t-=79,r+=95>=1)<=47?t+=112:t-=80,r+=126),l[l.length]=255&t,l[l.length]=255&r)):l[l.length]=255&n[f];return l}function f(n){for(var e,t,r,o=[],i=0,l=n&&n.length;i>8)-128&255,o[o.length]=(255&r)-128&255):(65536>8)-128&255,o[o.length]=(255&r)-128&255))):o[o.length]=255&n[i];return o}function g(n){for(var e,t,r,o=[],i=0,l=n&&n.length,f=0,u=[27,40,66,27,36,66,27,40,73,27,36,40,68];f>8&255,o[o.length]=255&r):(65536>8&255),o[o.length]=255&r));return 0!==i&&(o[o.length]=u[0],o[o.length]=u[1],o[o.length]=u[2]),o}function c(n){for(var e,t,r=[],o=0,i=n&&n.length;o>6&31,r[r.length]=128|63&e):e<65536?(r[r.length]=224|e>>12&15,r[r.length]=128|e>>6&63,r[r.length]=128|63&e):e<2097152&&(r[r.length]=240|e>>18&15,r[r.length]=128|e>>12&63,r[r.length]=128|e>>6&63,r[r.length]=128|63&e);return r}function s(n){for(var e,t,r,o=[],i=0,l=n&&n.length;i>4)&&e<=7?r=t:12==e||13==e?r=(31&t)<<6|63&n[i++]:14==e?r=(15&t)<<12|(63&n[i++])<<6|63&n[i++]:15==e&&(r=(7&t)<<18|(63&n[i++])<<12|(63&n[i++])<<6|63&n[i++]),r<=65535?o[o.length]=r:(r-=65536,o[o.length]=55296+(r>>10),o[o.length]=r%1024+56320);return o}function U(n,e){var t;if(e&&e.bom){var r,o,i=e.bom;h.isString(i)||(i="BE"),o="B"===i.charAt(0).toUpperCase()?(r=[254,255],_(n)):(r=[255,254],E(n)),(t=[])[0]=r[0],t[1]=r[1];for(var l=0,f=o.length;l>8&255,t[t.length]=255&e);return t}function E(n){for(var e,t=[],r=0,o=n&&n.length;r>8&255);return t}function A(n){var e,t,r=[],o=0,i=n&&n.length;for(2<=i&&(254===n[0]&&255===n[1]||255===n[0]&&254===n[1])&&(o=2);o>=1)<47?e+=113:e-=79,t+=95>=1)<=47?e+=112:e-=80,t+=126),r[r.length]=255&e,r[r.length]=255&t):r[r.length]=2===o?n[i]+128&255:3===o?a.UNKNOWN_CHARACTER:255&n[i]}return r},t.JISToEUCJP=function(n){for(var e=[],t=0,r=n&&n.length,o=0;o>=1,e+=e<111?49:113,t-=223>=1,e+=e<=111?48:112,t-=2),r[r.length]=255&e,r[r.length]=255&t):r[r.length]=142===e?255&n[++i]:255&e;return r},t.SJISToUTF8=r,t.EUCJPToUTF8=o,t.JISToUTF8=i,t.UTF8ToSJIS=l,t.UTF8ToEUCJP=f,t.UTF8ToJIS=g,t.UNICODEToUTF8=c,t.UTF8ToUNICODE=s,t.UNICODEToUTF16=U,t.UNICODEToUTF16BE=_,t.UNICODEToUTF16LE=E,t.UTF16BEToUNICODE=A,t.UTF16LEToUNICODE=S,t.UTF16ToUNICODE=d,t.UTF16ToUTF16BE=function(n){for(var e,t,r=[],o=0,i=n&&n.length,l=!1,f=!0;o>4&15],r[r.length]=t[15&e]))}return u.codeToString_fast(r)},urlDecode:function(n){for(var e,t=[],r=0,o=n&&n.length;ri.APPLY_BUFFER_SIZE&&(i.APPLY_BUFFER_SIZE_OK=!0),t}catch(n){i.APPLY_BUFFER_SIZE_OK=!1}}return a(n)}function a(n){for(var e,t="",r=n&&n.length,o=0;oi.APPLY_BUFFER_SIZE&&(i.APPLY_BUFFER_SIZE_OK=!0);continue}catch(n){i.APPLY_BUFFER_SIZE_OK=!1}return T(n)}t+=l.apply(null,e)}return t}function T(n){for(var e="",t=n&&n.length,r=0;r>2],e[e.length]=c[(3&o)<<4],e[e.length]=U,e[e.length]=U;break}if(i=n[t++],t==r){e[e.length]=c[o>>2],e[e.length]=c[(3&o)<<4|(240&i)>>4],e[e.length]=c[(15&i)<<2],e[e.length]=U;break}l=n[t++],e[e.length]=c[o>>2],e[e.length]=c[(3&o)<<4|(240&i)>>4],e[e.length]=c[(15&i)<<2|(192&l)>>6],e[e.length]=c[63&l]}return h(e)},t.base64decode=function(n){var e,t,r,o,i,l,f;for(l=n&&n.length,i=0,f=[];i>4;do{if(61==(r=255&n.charCodeAt(i++)))return f;r=s[r]}while(i>2;do{if(61==(o=255&n.charCodeAt(i++)))return f;o=s[o]}while(i