1. UrlEncode编码
echo '张飞' | tr -d '\n' | xxd -plain | sed 's/\(..\)/%\1/g'echo '张飞' |tr -d '\n' |od -An -tx1|tr ' ' %
2. UrlEncode解码
url="%e5%bc%a0%e9%a3%9e"printf $(echo -n $url | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"
时间:2023-08-24 16:48:52
echo '张飞' | tr -d '\n' | xxd -plain | sed 's/\(..\)/%\1/g'echo '张飞' |tr -d '\n' |od -An -tx1|tr ' ' %
url="%e5%bc%a0%e9%a3%9e"printf $(echo -n $url | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"