如何把中文转换为UNICODE?

2023-12-05 0 129

<%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 j<0 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 j>linelen*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 & \”&apos;\”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 (asctemp>47 and asctemp<58) or (asctemp>64 and asctemp<91) or (asctemp>96 and asctemp<123) thenstrtemp=strtemp & cend ifnextconvertstring=Lcase(strtemp)end function%>

[1]

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 编程10000问 如何把中文转换为UNICODE? https://www.u-9.cn/biancheng/bc10000/96573.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务