echo '你好中国' | tr -d '\n' | xxd -plain | sed 's/\(..\)/%\1/g' echo '你好中国' |tr -d '\n' |od -An -tx1|tr ' ' %
printf $(echo -n $urlcode | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"
echo '你好中国' | tr -d '\n' | xxd -plain | sed 's/\(..\)/%\1/g' echo '你好中国' |tr -d '\n' |od -An -tx1|tr ' ' %
printf $(echo -n $urlcode | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"
shell下urlencode/urldecode编码解码
https://www.hao.kim/archives/331.html