Repo containing scripts to be used with dovel, and git hooks that powers our web interface.
Author: blmayer (bleemayer@gmail.com)
Date: Fri Jan 19 15:29:20 2024 -0300
Parent: 243a165
Added decode function
diff --git a/aux.sh b/aux.sh index d5075b6..f1beaec 100755 --- a/aux.sh +++ b/aux.sh @@ -211,3 +211,55 @@ mdown() { [ "$p" -gt "0" ] && printf "\n</p>\n" set +f } + +decode() { + case "$1" in + "=?iso-8859-1?Q?"*) + printf "%s" "$@" | sed -e 's/=?iso-8859-1?Q?//Ig' \ + -e 's/?=//g' \ + -e 's/=E7/ç/g' \ + -e 's/=ED/í/g' \ + -e 's/_/ /g' \ + -e 's/=E3/ã/g' + ;; + "=?utf-8?q?"* | "=?utf-8?Q?"* | "=?UTF-8?q?"* | "=?utf-8; format?q?"*) + printf "%s" "$@" | sed -e 's/.*=?utf-8\(; format\)\??q?//Ig' \ + -e 's/?=//g' \ + -e 's/=F0=9F=8F=AD=C2=A0/🏭/g' \ + -e 's/=C2=A0=F0=9F=91=87/👇/g' \ + -e 's/=F0=9F=94=A5/🔥/g' \ + -e 's/=e2=80=93/-/g' \ + -e 's/=E2=80=99/’/g' \ + -e 's/=CE=94/Δ/g' \ + -e 's/=C3=BA/ú/g' \ + -e 's/=C3=B5/õ/g' \ + -e 's/=C3=B4/ô/g' \ + -e 's/=C3=B3/ó/g' \ + -e 's/=C3=96/Ö/g' \ + -e 's/=C3=AD/í/g' \ + -e 's/=C3=A9/é/g' \ + -e 's/=C3=AA/ê/g' \ + -e 's/=C3=A7/ç/g' \ + -e 's/=C3=A3/ã/g' \ + -e 's/=C3=A2/â/g' \ + -e 's/=C3=A1/á/g' \ + -e 's/=C3=A0/à/g' \ + -e 's/=3F/?/g' \ + -e 's/=2D/-/g' \ + -e 's/=2C/,/g' \ + -e 's/=20/ /g' \ + -e 's/=20/ /g' \ + -e 's/=20/ /g' \ + -e "s/=27/\\'/g" + -e 's/=28/(/g' \ + -e 's/=29/)/g' \ + -e 's/=21/!/g' \ + -e 's/_/ /g' \ + -e 's/=20/ /g' + ;; + "=?UTF-8?B?"* | "=?utf-8?B?"*) + printf "%s" "$@" | sed -e 's/=?UTF-8?B?//Ig' \ + -e 's/?=//g' | base64 -d + ;; + esac +}