diff options
author | Mathias Bynens <mathias@qiwi.be> | 2011-12-28 13:08:44 +0100 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2011-12-28 13:08:44 +0100 |
commit | fad95362fbcb3b12e6e8862892c7f2323f6d340c (patch) | |
tree | 4eec0ec6f18565dbab6d9da2a5f05de12ec3ee07 | |
parent | e3c4b0e821b41f5091d12c1fc1b235a9c9c710f4 (diff) | |
download | dotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.tar.gz dotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.tar.bz2 dotfiles-fad95362fbcb3b12e6e8862892c7f2323f6d340c.zip |
Add `unidecode` function
Example:
$ unidecode "\x{1D306}"
𝌆
-rw-r--r-- | .functions | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |