如何把中文轉(zhuǎn)換為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
%><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
[1]
上一篇:如何實(shí)現(xiàn)歌曲在線點(diǎn)播?
欄 目:編程問(wèn)答
本文標(biāo)題:如何把中文轉(zhuǎn)換為UNICODE?
本文地址:http://mengdiqiu.com.cn/a1/bianchengwenda/12073.html
您可能感興趣的文章
- 01-11如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?
- 01-11如何判斷電子郵件的地址格式是否正確?
- 01-11如何做一個(gè)文本搜索?
- 01-11如何實(shí)現(xiàn)網(wǎng)上考試?
- 01-11如何實(shí)現(xiàn)全文檢索?
- 01-11如何用POP3接收電子郵件?
- 01-11如何使用表單發(fā)送電子郵件?
- 01-11如何在線更改密碼?
- 01-11如何取回已忘記的密碼?
- 01-11如何做一個(gè)隨機(jī)密碼產(chǎn)生器?


閱讀排行
- 1C語(yǔ)言 while語(yǔ)句的用法詳解
- 2java 實(shí)現(xiàn)簡(jiǎn)單圣誕樹(shù)的示例代碼(圣誕
- 3利用C語(yǔ)言實(shí)現(xiàn)“百馬百擔(dān)”問(wèn)題方法
- 4C語(yǔ)言中計(jì)算正弦的相關(guān)函數(shù)總結(jié)
- 5c語(yǔ)言計(jì)算三角形面積代碼
- 6什么是 WSH(腳本宿主)的詳細(xì)解釋
- 7C++ 中隨機(jī)函數(shù)random函數(shù)的使用方法
- 8正則表達(dá)式匹配各種特殊字符
- 9C語(yǔ)言十進(jìn)制轉(zhuǎn)二進(jìn)制代碼實(shí)例
- 10C語(yǔ)言查找數(shù)組里數(shù)字重復(fù)次數(shù)的方法
本欄相關(guān)
- 01-11如何實(shí)現(xiàn)點(diǎn)擊數(shù)的計(jì)算?
- 01-11如何做一個(gè)文本搜索?
- 01-11如何判斷電子郵件的地址格式是否正
- 01-11如何實(shí)現(xiàn)全文檢索?
- 01-11如何實(shí)現(xiàn)網(wǎng)上考試?
- 01-11如何使用表單發(fā)送電子郵件?
- 01-11如何用POP3接收電子郵件?
- 01-11如何取回已忘記的密碼?
- 01-11如何在線更改密碼?
- 01-11如何做一個(gè)隨機(jī)密碼產(chǎn)生器?
隨機(jī)閱讀
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 01-11ajax實(shí)現(xiàn)頁(yè)面的局部加載
- 04-02jquery與jsp,用jquery
- 01-10使用C語(yǔ)言求解撲克牌的順子及n個(gè)骰子
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 01-10SublimeText編譯C開(kāi)發(fā)環(huán)境設(shè)置
- 01-11Mac OSX 打開(kāi)原生自帶讀寫(xiě)NTFS功能(圖文
- 01-10C#中split用法實(shí)例總結(jié)
- 01-10delphi制作wav文件的方法