We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <script> function toUnicodeFun(data) { if (data == '' || typeof data == 'undefined') return '请输入汉字' var str = '' for (var i = 0; i < data.length; i++) { let s = data.charCodeAt(i).toString(16).toUpperCase() str += '\\u' + s } return str } let code = toUnicodeFun('请修改') console.log('unicode:', code) function toChineseWords(data) { if (data == '' || typeof data == 'undefined') return '请输入十六进制unicode' data = data.split('\\u') var str = '' for (var i = 0; i < data.length; i++) { str += String.fromCharCode(parseInt(data[i], 16).toString(10)) } return str } let zh = toChineseWords(code) console.log('zh:', zh) </script> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
参考
The text was updated successfully, but these errors were encountered: