<script language="JAVASCRIPT" runat="server"> var ss; var dd; ss=decodeURIComponent("%E6%B1%89%E5%AD%97"); dd=encodeURIComponent("汉字"); </script> 符合GOOGLE的UTF编码 <p> 汉字 经过encodeURIComponent变成 <%=dd%> </p> <p> %E6%B1%89%E5%AD%97经过decodeURIComponent变成 <%=ss%> </p>
<script language="vbscript" runat="server"> Function AnsiCode(vstrIn) Dim i, strReturn, innerCode, ThisChr Dim Hight8, Low8 strReturn = "" For i = 1 To Len(vstrIn) ThisChr = Mid(vStrIn,i,1) If Abs(Asc(ThisChr)) < &HFF Then strReturn = strReturn & ThisChr Else innerCode = Asc(ThisChr) If innerCode < 0 Then innerCode = innerCode + &H10000 End If Hight8 = (innerCode And &HFF00) / &HFF Low8 = innerCode And &HFF strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8) End If Next AnsiCode = strReturn End Function