java,php,asp.net,linux,javascript,mysql,mssql,oracle,编程

解码

转载请注明:http://www.pmjava.com/Article/ShowInfo.asp?ID=56660
Function UrlDecode(encodestr)
Dim NewStr
NewStr
=""
havechar
=false
lastchar
=""
For i=1 To Len(encodestr)
   char_c
=Mid(encodestr,i,1)
  
If char_c = "+" Then
      newstr
=newstr & " "
  
Elseif char_c="%" then
      next_1_c
=Mid(encodestr,i+1,2)
      next_1_num
=CInt("&H" & next_1_c)

     
If havechar Then
         havechar
=false
         newstr
=newstr & chr(Cint("&H" & lastchar & next_1_c))
     
Else
        
If Abs(next_1_num)<=127 Then
            newstr
=newstr & chr(next_1_num)
        
Else
            havechar
=true
            lastchar
=next_1_c
        
End If
     
End If
      i
=i+2
  
Else
      newstr
=newstr & char_c
  
End If

Next
urldecode
=newstr
End function

posted on 2009-06-10 22:05 rrong_m 阅读(107) 评论(0)  编辑  收藏 所属分类: javascript

<2025年2月>
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678

导航

统计

常用链接

随笔档案

文章分类

文章档案

java编程

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜