Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/beximco/mrp_process/node_modules/encode-utf8/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict'
module.exports = function encodeUtf8 (input) {
var result = []
var size = input.length
for (var index = 0; index < size; index++) {
var point = input.charCodeAt(index)
if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {
var second = input.charCodeAt(index + 1)
if (second >= 0xDC00 && second <= 0xDFFF) {
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000
index += 1
}
}
// US-ASCII
if (point < 0x80) {
result.push(point)
continue
}
// 2-byte UTF-8
if (point < 0x800) {
result.push((point >> 6) | 192)
result.push((point & 63) | 128)
continue
}
// 3-byte UTF-8
if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {
result.push((point >> 12) | 224)
result.push(((point >> 6) & 63) | 128)
result.push((point & 63) | 128)
continue
}
// 4-byte UTF-8
if (point >= 0x10000 && point <= 0x10FFFF) {
result.push((point >> 18) | 240)
result.push(((point >> 12) & 63) | 128)
result.push(((point >> 6) & 63) | 128)
result.push((point & 63) | 128)
continue
}
// Invalid character
result.push(0xEF, 0xBF, 0xBD)
}
return new Uint8Array(result).buffer
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0087 ]-- |