encodeURI("Hello World!世界你好!") ->String->UTF8 URLEncode
你一定要那个Ascii URLEncode,要么从vbs那里引用一个Asc函数过来,要么就去找一下秋水无痕的代码,她用字典转换了

解决方案 »

  1.   

    <script language="vbscript">
    Function urlEncode(vstrin)
      Dim i, strreturn, strSpecial
      Dim thischr, innercode
      Dim hight8, low8  strSpecial = " <>'""#%{}\|^~[]`&?+"
      strreturn = ""
      For i = 1 To Len(vstrin)
        thischr = Mid(vstrin, i, 1)
        If Abs(Asc(thischr)) < &HFF Then
          If inStr(strSpecial, thischr) > 0 Then
            strreturn = strreturn & "%" & Hex(Asc(thischr))
          Else
            strreturn = strreturn & thischr
          End If
        Else
          innercode = Asc(thischr)
          If innercode < 0 Then innercode = innercode + &H10000
          hight8 = (innercode And &HFF00) \ &HFF
          low8 = innercode And &HFF
          strreturn = strreturn & "%" & Hex(hight8) &  "%" & Hex(low8)
        End If
      Next
      urlEncode = strreturn
    End Function
    </script><script language="javascript">
    alert(urlEncode("哈哈"));          //这样就可以用了,干嘛要转换呢?
    </script>