逆战回归老兵补给箱:~~~~~~~~求百度贴吧地址编码查询的网址或工具~~~~~

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/09 03:24:45

http://post.baidu.com/f?kw=%B6%E0%D3%E0
是进多余吧
%B6%E0%D3%E0是多余
那么 你欠我钱编码 是什么?
贴吧编码 又是是什么?
等~~~~~~~

请高手告诉查询的工具或者网页谢谢~~~~
1楼的用不了~~
2楼的能用

<---qq19443156--->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
BODY {
FONT-SIZE: 9pt; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px;
}
input {
FONT-SIZE: 9pt; height: 13pt;
}
</style>

<script language="JavaScript1.2">

String.prototype.GetCount = function(str,mode){return eval("this.match(/("+str+")/g"+(mode?"i":"")+").length");}

function UrlEncode(str){
/*-- Modify from qiushuiwuhen --*/
var i,temp,p,q;
var result="";
for(i=0;i<str.length;i++){
temp = str.charCodeAt(i);
if(temp>=0x4e00){
execScript("ascCode=hex(asc(\""+str.charAt(i)+"\"))", "vbscript");
result+=ascCode.replace(/(.{2})/g, "%$1");
}else{
result+=escape(str.charAt(i));
}
}
return result;
}

function UrlDecode(str){
var i,temp;
var result="";
for(i=0;i<str.length;i++){
if(str.charAt(i)=="%"){
if(str.charAt(++i)=="u"){
temp=str.charAt(i++) + str.charAt(i++) + str.charAt(i++) + str.charAt(i++) + str.charAt(i);
result += unescape("%" + temp);
}else{
temp = str.charAt(i++) + str.charAt(i);
if(eval("0x"+temp)<=160){
result += unescape("%" + temp);
}else{
temp += str.charAt(++i) + str.charAt(++i) + str.charAt(++i);
result += Decode_unit("%" + temp);
}
}
}else{
result += str.charAt(i);
}
}
return result;
}

function Decode_unit(str){
var p,q = "";
if(str.GetCount("%")!=2)return str;
p=eval("0x" + str.split("%")[1]);
q=eval("0x" + str.split("%")[2]);
if(p<160 || q<160)return unescape(str);
str=str.replace(/%/g,"");
execScript("temp=&H"+str, "vbscript");
execScript("result=chr("+temp+")", "vbscript");
return result;
}

function modi_str(){
if(document.all.text.method.checked){
if(document.all.text.decode.value!=""){
document.all.text.encode.value = UrlEncode(document.all.text.decode.value);
}else{
document.all.text.decode.value = UrlDecode(document.all.text.encode.value);
}
}else{
if(document.all.text.encode.value!=""){
document.all.text.decode.value = UrlDecode(document.all.text.encode.value);
}else{
document.all.text.encode.value = UrlEncode(document.all.text.decode.value);
}
}
}
</script>
<title>Urlcode</title>
<form name=text>

转换代码:<br>
<textarea name="encode" cols="100" rows="10"></textarea>
文本原型:<br>
<textarea name="decode" cols="100" rows="10"></textarea>
<br> <br>
<input type="checkbox" name="method"> 正向转换
<input type=button onclick="modi_str()" value=" 确 定 ">
<input type=reset value=" 清 空 ">
<input type=button onclick="document.all.text.method.checked?document.all.text.encode.select():Document.all.text.decode.select()" value=" 全 选 ">
</form>
以上存为HTML文件就可以了

那是UTF-8编码,给你一个UTF-8转GB2312的程序原代码(ASP的):

<%

Response.write UTF2GB2312(Request.querystring("utf8"))

function UTF2GB2312(UTFStr)
for Dig=1 to len(UTFStr)
if mid(UTFStr,Dig,1)="%" then
if len(UTFStr) >= Dig+8 then
GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9))
Dig=Dig+8
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
else
GBStr=GBStr & mid(UTFStr,Dig,1)
end if
next
UTF2GB=GBStr
end function

function ConvChinese(x)
A=split(mid(x,2),"%")
i=0
j=0

for i=0 to ubound(A)
A(i)=c16to2(A(i))
next

for i=0 to ubound(A)-1
DigS=instr(A(i),"0")
Unicode=""
for j=1 to DigS-1
if j=1 then
A(i)=right(A(i),len(A(i))-DigS)
Unicode=Unicode & A(i)
else
i=i+1
A(i)=right(A(i),len(A(i))-2)
Unicode=Unicode & A(i)
end if
next

if len(c2to16(Unicode))=4 then
ConvChinese=ConvChinese & chrw(int("&H" & c2to16(Unicode)))
else
ConvChinese=ConvChinese & chr(int("&H" & c2to16(Unicode)))
end if
next
end function

function c2to16(x)
i=1
for i=1 to len(x) step 4
c2to16=c2to16 & hex(c2to10(mid(x,i,4)))
next
end function

function c2to10(x)
c2to10=0
if x="0" then exit function
i=0
for i= 0 to len(x) -1
if mid(x,len(x)-i,1)="1" then c2to10=c2to10+2^(i)
next
end function

function c16to2(x)
i=0
for i=1 to len(trim(x))
tempstr= c10to2(cint(int("&h" & mid(x,i,1))))
do while len(tempstr)<4
tempstr="0" & tempstr
loop
c16to2=c16to2 & tempstr
next
end function

function c10to2(x)
mysign=sgn(x)
x=abs(x)
DigS=1
do
if x<2^DigS then
exit do
else
DigS=DigS+1
end if
loop
tempnum=x

i=0
for i=DigS to 1 step-1
if tempnum>=2^(i-1) then
tempnum=tempnum-2^(i-1)
c10to2=c10to2 & "1"
else
c10to2=c10to2 & "0"
end if
next
if mysign=-1 then c10to2="-" & c10to2
end function
%>

如果有哪位高人懂得将UTF-7到GB2312的方法,请到这里回答一下,谢谢你哦!

http://zhidao.baidu.com/question/3308112.html