Function fnDecode(inString As String) As String inString=Replace(inString,"+"," ") Dim L As String Dim M As String Dim R As String Dim P As Integer Dim TP As Integer Dim fnDecode1 As String Dim rstr As String If Instr(inString,"%")>0 Then TempStr=inString Do While Instr(TempStr,"%")>0 P=Instr(TempStr,"%") L=Left(TempStr,P-1) M=Mid(TempStr,P+1,5) If Cint("&H"+Left(M,1))<10 Then M=Left(M,2) If M="0A" Or M="0D" Then If M="0D" Then rstr=rstr+L+"<br>" End If Else rstr=rstr+L+Chr(Clng("&H"+M)) End If TP=(P+2) Else M=Left(M,2)+Right(M,2) rstr=rstr+L+Chr(Clng("&H"+M)) TP=(P+5) End If R=Right(TempStr,Len(TempStr)-TP) TempStr=R Loop fnDecode=rstr+TempStr Else fnDecode = inString End If End Function
本函数可以解析由Lotus产生的编码,特别是在Query_string_decoded域不起作用的时候,需要这个函数来解码.如使用中有问题可以到http://www.oaunion.com/bbs的lotus讨论中心中提出.

|