内容摘要:
%functionunicode(str)dimi,j,c,i1,i2,u,fs,f,punicode=''p=''fori=1tolen(str)c=mid(str,i,1)j=ascw(c)ifj0thenj=j+65536endififj=0andj=128thenifp='c'thenunicode=''unicodep='e'endifunicod......
|
<%
functionunicode(str)
dimi,j,c,i1,i2,u,fs,f,p
unicode=""
p=""
fori=1tolen(str)
c=mid(str,i,1)
j=ascw(c)
ifj<0then
j=j+65536
endif
ifj>=0andj<=128then
ifp="c"then
unicode=""&unicode
p="e"
endif
unicode=unicode&c
else
ifp="e"then
unicode=unicode&""
p="c"
endif
unicode=unicode&"&#"&j&";"
endif
next
endfunction
functioncutline(str,linelen)
dimi,j,c,k
cutline=""
j=0
fori=1tolen(str)
c=mid(str,i,1)
ifasc(c)<0orasc(c)>127then
k=2
else
ifasc(c)<32then
k=0
ifasc(c)=13then
j=0
cutline=cutline+"<br/>"+c
c=""
endif
else
k=1
endif
endif
j=j+k
ifj>linelen*2then
cutline=cutline+"<br/>"+vbCrlf+c
j=k
else
cutline=cutline+c
endif
next
endfunction
functionconvertsymbol(sStr)
dimi,c
convertsymbol=""
fori=1tolen(sStr)
c=mid(sStr,i,1)
ifc=">"then
convertsymbol=convertsymbol&">"
elseifc="<"then
convertsymbol=convertsymbol&"<"
elseifc="'"then
convertsymbol=convertsymbol&"'"
elseifc=""""then
convertsymbol=convertsymbol&"""
elseifc="&"then
convertsymbol=convertsymbol&"&"
elseifc="$"then
convertsymbol=convertsymbol&"$$"
else
convertsymbol=convertsymbol&c
endif
next
endfunction
functionconvertstring(sStr)
dimstrtemp,asctemp,c
strtemp=""
fori=1tolen(sStr)
c=mid(sStr,i,1)
asctemp=ascw(c)
if(asctemp>47andasctemp<58)or(asctemp>64andasctemp<91)or(asctemp>96andasctemp<123)then
strtemp=strtemp&c
endif
next
convertstring=Lcase(strtemp)
endfunction
%>
|