Today, I encountered the problem of encoding conversion. After working on sxna, I worked on it for more than an hour and went through a lot of hardships. Finally, I summarized the following Chinese characters to various UTF-8 UnicodeAnsi encoding programs. I dare not enjoy it alone, so I will dedicate it to all programming enthusiasts!
--------------------------------------------------------------------------------
UTF encoding that complies with GOOGLE
Chinese characters become %E6%B1%89%E5%AD%97 through encodeURIComponent
%E6%B1%89%E5%AD%97 becomes Chinese characters through decodeURIComponent
Search for "Chinese characters" using Google:
http://www.google.com/search?hl=zh-CN&q=%E6%B1%89%E5%AD%97
UTF-8 encoding that complies with BAIDU
Chinese characters become %BA%BA%D7%D6 through AnsiCode
BA%BA%D7%D6 becomes Chinese characters through DeCodeAnsi
Search for "Chinese characters" with baidu:
http://www.baidu.com/baidu?word=%BA%BA%D7%D6
--------------------------------------------------------------------------------
Chinese characters are changed into Chinese characters through chinese2unicode
Chinese characters are transformed into Chinese characters through UTF2GB
--------------------------------------------------------------------------------
The original test.asp program is as follows
(Download the source program http://www.dc9.cn/upload/test.rar)
The code copy is as follows:
UTF-8UnicodeAnsi Chinese Character GB2321 Several encoding conversion programs
Today I was working on SXNA, and I encountered the problem of encoding conversion. I searched for more than an hour and went through a lot of hardships. Finally, I summarized the following Chinese characters to convert various UTF-8 UnicodeAnsi encoding programs. I dare not enjoy it alone, so I will dedicate it to all programming enthusiasts!
<scriptlanguage="JAVASCRIPT"runat="server">
varss;
vardd;
ss=decodeURIComponent("%E6%B1%89%E5%AD%97");
dd=encodeURIComponent("Chinese Character");
</script>
UTF encoding that complies with GOOGLE
<p>
Chinese characters become encodeURIComponent
<%=dd%>
</p>
<p>
%E6%B1%89%E5%AD%97 becomes
<%=ss%>
</p>
<scriptlanguage="vbscript"runat="server">
FunctionAnsiCode(vstrIn)
Dimi, strReturn, innerCode, ThisChr
DimHight8,Low8
strReturn=""
Fori=1ToLen(vstrIn)
ThisChr=Mid(vStrIn,i,1)
IfAbs(Asc(ThisChr))<&HFFTThen
strReturn=strReturn&ThisChr
Else
innerCode=Asc(ThisChr)
IfinnerCode<0Then
innerCode=innerCode+&H10000