日期:2014-05-16  浏览次数:20911 次

\u6211\u4eec\u4e2d如何转换成中文
如何直接输出“我们中”

下面是Js代码。如何写在 asp代码

function asciiConvertNative() {
    var asciicode = getid("asciicode").value.split("\\u");
    var nativeValue = asciicode[0];
    for (var i = 1; i < asciicode.length; i++) {
        var code = asciicode[i];
        nativeValue += String.fromCharCode(parseInt("0x" + code.substring(0, 4)));
        if (code.length > 4) {
            nativeValue += code.substring(4, code.length);
        }
    }
    getid("nativecode").value = nativeValue;
}
------解决方案--------------------
用eval()转码!
------解决方案--------------------
<script runat="server" language="javascript">
    function HexToString(v) { return eval("'" + v + "'"); }
</script>
<%
s="\u6211\u4eec\u4e2d"
response.Write HexToString(s)
 %>

------解决方案--------------------
你编码的问题,asp要启用utf-8编码