aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2012-03-28 04:55:03 -0700
committerMathias Bynens <mathias@qiwi.be>2012-03-28 04:55:03 -0700
commite74cbc17cffc01021725cdaee16efd30c8135af4 (patch)
tree8497920e2e90446e101bd1e973747a308efd651b /.functions
parentb78d8cfd2f1e003228df9d4331e89e711f03dbec (diff)
parenta514cb3adf7002811de473177d385723b23fe5b4 (diff)
downloaddotfiles-e74cbc17cffc01021725cdaee16efd30c8135af4.tar.gz
dotfiles-e74cbc17cffc01021725cdaee16efd30c8135af4.tar.bz2
dotfiles-e74cbc17cffc01021725cdaee16efd30c8135af4.zip
Merge pull request #44 from pkruithof/patch-1
.functions: Add `codepoint` function $ codepoint € U+20AC $ codepoint ð U+00F0
Diffstat (limited to '.functions')
-rw-r--r--.functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/.functions b/.functions
index 67e64d6..900df56 100644
--- a/.functions
+++ b/.functions
@@ -62,4 +62,10 @@ function escape() {
function unidecode() {
perl -e "binmode(STDOUT, ':utf8'); print \"$@\""
echo # newline
+}
+
+# Get a character's unicode codepoint
+function codepoint() {
+ perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))"
+ echo # newline
} \ No newline at end of file