function strLength(str)
dim WINNT_CHINESE
WINNT_CHINESE=(len("飞鸟")=2)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
rem asc对中文字符求出来的值可能为负数,
rem 加上65536就可求出它的无符号数值
rem -1在机器内是用补码表示的0xffff,
rem 其无符号值为65535,65535=-1+65536
rem 其他负数依次类推。
if c>255 then
t=t+1
end if
next
strLength=t
else 
strLength=len(str)
end if
end function copyright aspcn.com