<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Unicode编码转换为中文</title>
</head>
<body>
<input type="text" id="inputBox">
<button onclick="convert()">转换</button>
<script>
function convert() {
var input = document.getElementById("inputBox").value;
var output = "";
for (var i = 0; i < input.length; i++) {
if (input.charCodeAt(i) > 127) {
output += "\\u" + input.charCodeAt(i).toString(16);
} else {
output += input.charAt(i);
}
}
document.getElementById("inputBox").value = unescape(output.replace(/\\/g, "%"));
}
</script>
</body>
</html>