我想把文本输入的全部内容转换成unicode码来发送短信! 这是我转换的测试页 <form name="form2" method="post" action=""> <table width="227" border="0"> <tr><td width="168"><input name="txtcode" type="text" id="txtcode"> </td><td width="42"><input type="submit" name="Submit" value="提交"> </td> </tr> </table> </form> <% content=request("txtcode")
Function URLEncoding(vstrIn) 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 URLEncoding = strReturn End Function
codema=URLEncoding(content) response.Write(codema) '想显示转换过的UNICODE码 response.End() %> 结果上面转换的是不正确的!各位路过的高手帮忙看看,有什么方法指点小弟一下!小弟谢谢了! 下面这函数为什么无法 转换呢?(我也是从论坛上看来的) Function c2u(myText) For i = 1 to Len(myText) c = Mid(myText, i, 1) c2u = c2u & "&#x" & Hex(AscW(c)) & ";" next End Function