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

发表于:2007-06-30来源:作者:点击数: 标签:
当然,把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问好!

原文转自:http://www.ltesting.net