for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=bstrlen then
titleb=left(str,i)
exit for
else
titleb=str&""
end if
next
End If
end function
function byteLen(str)
dim lenStr,lenTemp,i
lenStr=0
lenTemp=len(str)
dim strTemp
for i=1 to lenTemp
strTemp=asc(mid(str,i,1))
if strTemp>255 or strTemp<=0 then
lenStr=lenStr+2
else
lenStr=lenStr+1
end if
next
byteLen=lenStr
end function
End Class
%>









