lotus编码中文解码函数

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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讨论中心中提出.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有  導航