Created
December 1, 2014 00:20
-
-
Save talentdeficit/849183f95cabdae51f93 to your computer and use it in GitHub Desktop.
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
defp string_escape(<<?u, a1, b1, c1, d1, "\\u", a2, b2, c2, d2>> <> rest, acc) | |
when a1 in 'dD' and a2 in 'dD' | |
and (b1 in '89abAB') | |
and (b2 in ?c..?f or b2 in ?C..?F) \ | |
do | |
hi = List.to_integer([a1, b1, c1, d1], 16) | |
lo = List.to_integer([a2, b2, c2, d2], 16) | |
codepoint = 0x10000 + ((hi &&& 0x03FF) <<< 10) + (lo &&& 0x03FF) | |
string_continue(rest, [acc, <<codepoint :: utf8>>]) | |
end | |
--- | |
== Compilation error on file lib/poison.ex == | |
** (CompileError) lib/poison.ex:37: function '&&&'/2 undefined | |
(stdlib) lists.erl:1336: :lists.foreach/2 | |
(stdlib) erl_eval.erl:657: :erl_eval.do_apply/6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment