function UTF2GB(UTFStr)



for Dig=1 to len(UTFStr)

'如果UTF8编码文字以%开头则进行转换

if mid(UTFStr,Dig,1)="%" then

'UTF8编码文字大于8则转换为汉字

if len(UTFStr) >= Dig+8 then

GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))

Dig=Dig+8

else

GBStr=GBStr & mid(UTFStr,Dig,1)

end if

else

GBStr=GBStr & mid(UTFStr,Dig,1)

end if

next

UTF2GB=GBStr

end function