summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/xml/utf8_decode.js
diff options
context:
space:
mode:
authorMarvin Borner2018-11-07 22:10:16 +0100
committerMarvin Borner2018-11-07 22:10:17 +0100
commit954583f3d56fbfb60321725f13ad092e536e3737 (patch)
treea0505a763797582c61fd8c2f90b422456d8874c9 /node_modules/locutus/php/xml/utf8_decode.js
parent1c355e6e956a4e507ed5436d0c814ba9c3a1deb2 (diff)
Removed node_modules
Diffstat (limited to 'node_modules/locutus/php/xml/utf8_decode.js')
-rw-r--r--node_modules/locutus/php/xml/utf8_decode.js62
1 files changed, 0 insertions, 62 deletions
diff --git a/node_modules/locutus/php/xml/utf8_decode.js b/node_modules/locutus/php/xml/utf8_decode.js
deleted file mode 100644
index d27de52..0000000
--- a/node_modules/locutus/php/xml/utf8_decode.js
+++ /dev/null
@@ -1,62 +0,0 @@
-'use strict';
-
-module.exports = function utf8_decode(strData) {
- // eslint-disable-line camelcase
- // discuss at: http://locutus.io/php/utf8_decode/
- // original by: Webtoolkit.info (http://www.webtoolkit.info/)
- // input by: Aman Gupta
- // input by: Brett Zamir (http://brett-zamir.me)
- // improved by: Kevin van Zonneveld (http://kvz.io)
- // improved by: Norman "zEh" Fuchs
- // bugfixed by: hitwork
- // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
- // bugfixed by: Kevin van Zonneveld (http://kvz.io)
- // bugfixed by: kirilloid
- // bugfixed by: w35l3y (http://www.wesley.eti.br)
- // example 1: utf8_decode('Kevin van Zonneveld')
- // returns 1: 'Kevin van Zonneveld'
-
- var tmpArr = [];
- var i = 0;
- var c1 = 0;
- var seqlen = 0;
-
- strData += '';
-
- while (i < strData.length) {
- c1 = strData.charCodeAt(i) & 0xFF;
- seqlen = 0;
-
- // http://en.wikipedia.org/wiki/UTF-8#Codepage_layout
- if (c1 <= 0xBF) {
- c1 = c1 & 0x7F;
- seqlen = 1;
- } else if (c1 <= 0xDF) {
- c1 = c1 & 0x1F;
- seqlen = 2;
- } else if (c1 <= 0xEF) {
- c1 = c1 & 0x0F;
- seqlen = 3;
- } else {
- c1 = c1 & 0x07;
- seqlen = 4;
- }
-
- for (var ai = 1; ai < seqlen; ++ai) {
- c1 = c1 << 0x06 | strData.charCodeAt(ai + i) & 0x3F;
- }
-
- if (seqlen === 4) {
- c1 -= 0x10000;
- tmpArr.push(String.fromCharCode(0xD800 | c1 >> 10 & 0x3FF));
- tmpArr.push(String.fromCharCode(0xDC00 | c1 & 0x3FF));
- } else {
- tmpArr.push(String.fromCharCode(c1));
- }
-
- i += seqlen;
- }
-
- return tmpArr.join('');
-};
-//# sourceMappingURL=utf8_decode.js.map \ No newline at end of file