Vbscript Asp unicode编码转汉字
作者:admin 日期:2019-01-04
自己写的代码:
ASP/Visual Basic代码
- Function unicodetostr(text)
- unicodetostr=text
- if instr(text,"&#")>0 then
- str=split(text,"&#")
- for i=1 to ubound(str)
- str1=mid(str(i),1,instr(str(i),";")-1)
- 'response.write(str1&"<br/>")
- unicodetostr=replace(unicodetostr,"&#"&str1&";",chrw(str1))
- next
- end if
- end function
参考资料:https://zhidao.baidu.com/question/41686234.html
用Chr()函数把ascii码转化成汉字
用ChrW()函数把Unicode码转化成汉字
(还有之前说的AscW()函数返回值为负的时候,应加上65536 才得到汉字实际的Unicode码)
求汉字的Unicode代码 用AscW()函数
AscW("汉")=27721
求汉字的ASCII码 用Asc()函数 返回一个负数值
如Asc("汉")=-17734
上一篇: 记录一次Centos磁盘空间占满的解决办法
下一篇: mysql改变字符串的大小写转换
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: asp vb
相关日志:
下一篇: mysql改变字符串的大小写转换
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: asp vb
相关日志:
评论: 0 | 引用: 0 | 查看次数: 386
发表评论
广告位