Merge pull request #104 from goryn-clade/develop

Unicode fixes
This commit is contained in:
Tyr Heimdal
2023-01-23 20:14:38 +01:00
committed by GitHub

View File

@@ -951,13 +951,10 @@ define([
* @param text
* @returns {String}
*/
let unicodeToString = (text) => {
let result = text.replace(/\\u[\dA-F]{4}/gi,
function (match) {
return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16));
});
return result.substring(0, 2) == "u'" ? result.substring(2, result.length - 1) : result;
};
const unicodeToString = (text) => {
const result = text.replace(/\\u[\dA-F]{4}/gi, (match) => String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)))
return result.substring(0, 2) == "u'" ? result.substring(2, result.length - 1) : result
}
/**
* polyfill for "passive" events