Last active
November 15, 2016 12:16
-
-
Save duncdrum/2ad0da0415c02d83eff1d128f198e640 to your computer and use it in GitHub Desktop.
handy for unicode codepoint conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare function local:decimal-to-hex ($x as xs:integer) { | |
(:convert decimal codepoints to unicode hexadecimal :) | |
if ($x = 0) | |
then ('0') | |
else concat( | |
if ($x gt 16) | |
then (local:decimal-to-hex($x idiv 16)) | |
else (''), | |
substring('0123456789ABCDEF', | |
($x mod 16) + 1, 1)) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment