如何把中文转换为UNICODE?

%function unicode(str)dim i,j,c,i1,i2,u,fs,f,punicode=””p=””for i=1 to
len(str)c=mid(str,i,1)j=ascw(c)if j0 thenj=j+65536end ifif j=0 and j=128
thenif p=”c” thenunicode=” “&unicodep=”e”end ifunicode=unicode&celseif
p=”e” thenunicode=unicode&” “p=”c”end ifunicode=unicode&””&j&”;”end
ifnextend functionfunction cutline(str,linelen)dim
i,j,c,kcutline=””j=0for i=1 to len(str)c=mid(str,i,1)if asc(c)0 or
asc(c)127 thenk=2elseif asc(c)32 thenk=0if asc(c)=13
thenj=0cutline=cutline+”br/”+cc=””end ifelsek=1end ifend ifj=j+kif
jlinelen*2
thencutline=cutline+”br/”+vbCrlf+cj=kelsecutline=cutline+cend ifnextend
functionfunction convertsymbol(sStr)dim i,cconvertsymbol=””for i=1 to
len(sStr)c=mid(sStr,i,1)if c=”” thenconvertsymbol=convertsymbol &
“”elseif c=”” thenconvertsymbol=convertsymbol & “”elseif c=”‘”
thenconvertsymbol=convertsymbol & “”elseif c=””””
thenconvertsymbol=convertsymbol & “””elseif c=”&”
thenconvertsymbol=convertsymbol & “&”elseif c=”$”
thenconvertsymbol=convertsymbol & “$$”elseconvertsymbol=convertsymbol &
cend ifnextend functionfunction convertstring(sStr)dim
strtemp,asctemp,cstrtemp=””for i=1 to
len(sStr)c=mid(sStr,i,1)asctemp=ascw(c)if (asctemp47 and asctemp58) or
(asctemp64 and asctemp91) or (asctemp96 and asctemp123)
thenstrtemp=strtemp & cend ifnextconvertstring=Lcase(strtemp)end
function%

[1]

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图