unicode怎么转成中文

kasougrey
Apr 16, 2025, 3:18:58 PM
function unicodeToChar(str){
return str.replace(/\\u([0-9a-fA-F]{4})/g, (_, p1) => {
return String.fromCharCode(parseInt(p1, 16));
})
}

function main(params) {
var str = "\\u5b63\\u6210\\u8d85";
const data = unicodeToChar(str);
console.log(data);
return;
}
转不了,使用JSON.parse也不行
发表评论
最新评论
商务合作QQ:3765323427
Copyright © 2021-2025 冰狐智能辅助. All rights reserved. 浙ICP备15043866号 《冰狐智能辅助服务协议》