import"./encoding-japanese.min.js";function GB18030enc(str){const bytes=Encoding.convert(Encoding.stringToCode(str),{to:"GB18030",from:"UNICODE"});return bytes.map(b=>"%"+b.toString(16).padStart(2,"0").toUpperCase()).join("")}function GB18030dec(urlEncoded){const hexStrings=urlEncoded.match(/%[0-9a-fA-F]{2}/g)||[];const bytes=new Uint8Array(hexStrings.length);hexStrings.forEach((hex,index)=>{bytes[index]=parseInt(hex.slice(1),16)});return new TextDecoder("gb18030").decode(bytes)}export default{encode:GB18030enc,decode:GB18030dec};