当前位置:编程学习 > asp >>

做下载时,对中文名的处理办法

当然,把UTF-8选项去掉也行,这是另一种办法——
<html>
<%
gbstr="滚 ' 滚 ' 红 ' 尘.mp3"
unstr=""
for i=1 to len(gbstr)
    if asc(mid(gbstr,i,1))<0 then
        unstr=unstr & "%" & mid(hex(asc(mid(gbstr,i,1))),1,2) & "%" & mid(hex(asc(mid(gbstr,i,1))),3,2)
    else
        unstr=unstr & mid(gbstr,i,1)
    end if
next
response.write "<a href=" & chr(34) & unstr & chr(34) & ">" & gbstr & "</a>"
%>
</html>
BTW:很长时间没来了,向hooke问好!

补充:asp教程,技巧与性能优化
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,