aboutsummaryrefslogtreecommitdiffhomepage
path: root/alias
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2025-01-12 09:19:14 +0800
committerHsieh Chin Fan <pham@topo.tw>2025-01-12 09:19:14 +0800
commitac6ecd6b3399309b3e1baf68a4aa7782487925f6 (patch)
treec15480c7d8393833b9de8bcd6ea7019c3c015655 /alias
parent59c7600782b9b9ba5b879484795257bce95b1ce0 (diff)
Update
Diffstat (limited to 'alias')
-rw-r--r--alias4
1 files changed, 4 insertions, 0 deletions
diff --git a/alias b/alias
index d6420ae..2c2c87e 100644
--- a/alias
+++ b/alias
@@ -37,6 +37,10 @@ big52utf8() {
37utf82big5() { 37utf82big5() {
38 iconv -t BIG-5 -f UTF-8 38 iconv -t BIG-5 -f UTF-8
39} 39}
40urldecode() {
41 encoded="$(cat)"
42 echo ${encoded//\%/\\x}
43}
40urlencode() { 44urlencode() {
41 perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg' 45 perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg'
42 # Alternative: 46 # Alternative: