mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
15 lines
346 B
JavaScript
15 lines
346 B
JavaScript
#!/usr/bin/env node
|
|
|
|
function encode1(s) {
|
|
return encodeURI(s).replace(
|
|
/%(u[0-9A-F]{4})|(%[0-9A-F]{2})/gm,
|
|
function ($0, $1, $2) {
|
|
return ($1 && "\\" + $1.toLowerCase()) || decodeURI($2);
|
|
}
|
|
);
|
|
}
|
|
|
|
console.log(encode1('content:\\\\x22\\\\x22'))
|
|
console.log(encodeURI('\\\\x22\\\\x22'))
|
|
// console.log(JSON.parse())
|