JSFiddle - React, Tailwind, and code Playground
JavaScript
function numericEntityToChar(s) {
var re = /&#(\d+);/g,
ret = "", match;
while (match = re.exec(s)) {
ret += String.fromCharCode(match[1]);
}
return ret;
}
var str = "登入";
console.log(numericEntityToChar(str));