var pe = "%D6%D0%B9%FA";
pe="ÖÐ¹ú"
document.write("<p/>pe: "+pe);
document.write("<p/>de: "+IDecodeURIGb(pe, [CP936]));
document.write("<hr/>");
function IDecodeURIGb(Source, CP936) 
{ 
var bStr = false;
if(Source.constructor==String) Source = [Source], bStr = true;
var iLBound = iUBound = 0;
iLBound = -1; iUBound = 0x7f;
Source[0] = Source[0].replace(/\+/g, " ");
var Len = Source[0].length;
for(var i=0; i<Len; i++)
{
var iIndex = Source[0].indexOf("%", i);
if(iIndex===-1) break;
var sHex = Source[0].slice(iIndex+1, iIndex+3);
var iCode = parseInt(sHex, 16);
if(iCode>-1&&iCode<=0x7f) 
{
Source[0] =
[
Source[0].slice(0, iIndex)
, String.fromCharCode(iCode)
, Source[0].slice(iIndex+3)
].join("");
}
else
{
var sHexRaw = Source[0].slice(iIndex+3, iIndex+6);
if(sHexRaw.charAt(0)!="%") continue;
sHex += sHexRaw.slice(1);
var sUniHex = fGetUtfHex(sHex, CP936);
Source[0] =
[
Source[0].slice(0, iIndex)
, String.fromCharCode(parseInt(sUniHex, 16))
, Source[0].slice(iIndex+6)
].join("");
} 
} 
if(bStr) return Source[0];
} 
function fGetUtfHex(sGbHex, CP936)
{ 
sGbHex = sGbHex.toUpperCase();
var iIndex = CP936[0].indexOf(sGbHex);
if(iIndex===-1) return "0x005F";
var iBegin = iIndex+sGbHex.length+1;
return CP936[0].substring(iBegin, iBegin+6);
} 