标签:
编码的两种方式
echo ‘手机‘ | tr -d ‘\n‘ | xxd -plain | sed ‘s/\(..\)/%\1/g‘
echo ‘手机‘ |tr -d ‘\n‘ |od -An -tx1|tr ‘ ‘ %
解码
url="要解码的URL地址" printf $(echo -n $url | sed ‘s/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g‘)"\n"
标签:
原文地址:http://www.cnblogs.com/javaee6/p/4643210.html