如何把中文转换为UNICODE?
<%
function unicode(str)
dim i,j,c,i1,i2,u,fs,f,p
unicode=""
p=""
for i=1 to len(str)
c=mid(str,i,1)
j=ascw(c)
if j<0 then
j=j+65536
end if
if j>=0 and j<=128 then
if p="c" then
unicode=" "&unicode
p="e"
end if
unicode=unicode&c
else
if p="e" then
unicode=unicode&" "
p="c"
end if
unicode=unicode&""&j&";"
end if
next
end function
function cutline(str,linelen)
dim i,j,c,k
cutline=""
j=0
for i=1 to len(str)
c=mid(str,i,1)
if asc(c)<0 or asc(c)>127 then
k=2
else
if asc(c)<32 then
k=0
if asc(c)=13 then
j=0
cutline=cutline+"<br/>"+c
c=""
end if
else
k=1
end if
end if
j=j+k
if j>linelen*2 then
cutline=cutline+"<br/>"+vbCrlf+c
j=k
else
cutline=cutline+c
end if
next
end function
function convertsymbol(sStr)
dim i,c
convertsymbol=""
for i=1 to len(sStr)
c=mid(sStr,i,1)
if c=">" then
convertsymbol=convertsymbol & ">"
elseif c="<" then
convertsymbol=convertsymbol & "<"
elseif c="'" then
convertsymbol=convertsymbol & "'"
elseif c="""" then
convertsymbol=convertsymbol & """
elseif c="&" then
convertsymbol=convertsymbol & "&"
elseif c="$" then
convertsymbol=convertsymbol & "$$"
else
convertsymbol=convertsymbol & c
end if
next
end function
function convertstring(sStr)
dim strtemp,asctemp,c
strtemp=""
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) then
strtemp=strtemp & c
end if
next
convertstring=Lcase(strtemp)
end function
%>
[1]
- Python:如何将文本里的字典里的unicode字符转换成中文
- Python如何将Unicode中文字符串转换成 string字符串
- Python2如何将列表list的中文unicode转换为中文输出
- [python] 如何将unicode字符串转换为中文
- Scrapy爬虫框架抓取中文结果为Unicode编码,如何转换UTF-8编码的解决办法
- unicode转换成gbk或者中文
- Linux下在程序中如何进行繁体中文和简体中文的转换
- UniCode 下char*转CString ,利用MultiByteToWideChar进行转换,中文乱码的解决方案
- 如何利用java把文件中的Unicode字符转换为汉字
- Unicode编码与中文的转换
- 在url中进行中文参数传递如何转换
- 【整理】Python中,如何将反斜杠u类型(\uXXXX)的字符串,转换为对应的unicode的字符
- PHP的strtolower()和strtoupper()函数在安装非中文系统的服务器下可能会导致将汉字转换为乱码,请写两个替代的函数实现兼容Unicode文字的字符串大小写转换
- Unicode解码转换为中文
- 字符编码知识:Unicode、UTF-8、ASCII、GB2312等编码之间是如何转换的
- 如何进行文字和unicode相互转换
- UniCode 下CString 转 char*,利用WideCharToMultiByte进行转换,中文乱码的解决方案
- 如何把阿拉伯数字转换为中文大写?
- native2ascii 中文字符与Unicode编码相互转换
- Unicode 转换成 Ascii (把Unicode 中文字符串输入到文本中)