aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2011-12-28 13:08:44 +0100
committerMathias Bynens <mathias@qiwi.be>2011-12-28 13:08:44 +0100
commitfad95362fbcb3b12e6e8862892c7f2323f6d340c (patch)
tree4eec0ec6f18565dbab6d9da2a5f05de12ec3ee07 /.functions
parente3c4b0e821b41f5091d12c1fc1b235a9c9c710f4 (diff)
downloaddotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.tar.gz
dotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.tar.bz2
dotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.zip
Add `unidecode` function
Example: $ unidecode "\x{1D306}" 𝌆
Diffstat (limited to '.functions')
-rw-r--r--.functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/.functions b/.functions
index 0cdfebc..871275d 100644
--- a/.functions
+++ b/.functions
@@ -23,4 +23,10 @@ function digga() {
function escape() {
printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u)
echo # newline
+}
+
+# Decode \x{ABCD}-style Unicode escape sequences
+function unidecode() {
+ perl -e "binmode(STDOUT, ':utf8'); print \"$@\""
+ echo # newline
} \ No newline at end of file