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

response.Write("我")报错
貌似单个中文字符asp处理有问题。。。酱紫直接报错了


Microsoft VBScript 编译器错误 '800a0409'

未结束的字符串常量

\index.asp, line 14

现在我需要做的是,在index.asp的一个form中post过来一个文本,然后write出来。如果全部是中文或者全部是英文,处理良好,但是遇到中英混合或者单个中文字符就出问题了。代码和文件都是utf8编码,到底什么问题呢?贴个代码:

<%@Language="vbscript" Codepage="65001"%> 
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加留言</title>
</head>

<body style="width:100px; height:100px;">

<script language="javascript" type="text/javascript">
    setTimeout("javascript:location.href='index.asp'", 500);
</script>

    <%
    dim submitString
    submitString = Request.Form("Submit")
    if (submitString = "发表留言") Then    
        dim comment,nowTime
        nowTime=now()
        comment = Request.Form("comment")
        if( comment <> "") Then
            response.Write(nowTime)
            response.Write(comment)
        end if
    end if
    %>
</body>
</html>

乱码

------解决方案--------------------
并没发现有问题,你用记事本打开index.asp执行另存为,"编码"选择utf-8,然后再试试。
------解决方案--------------------
应该是编码问题,用记事本另存一下。
------解决方案--------------------
引用:
并没发现有问题,你用记事本打开index.asp执行另存为,"编码"选择utf-8,然后再试试。

应该是编码问题。
------解决方案--------------------
换IIS试试看, 可能是那个Web Server对中文支持不好。