[erlang-bugs] Unicode characters in binaries cause bad argument error

Kevin Albrecht onlyafly@REDACTED
Tue Feb 21 09:26:33 CET 2012


According to section "Basic language support for Unicode " of the
document "Using Unicode in Erlang"
<http://www.erlang.org/doc/apps/stdlib/unicode_usage.html#id61234>,
this syntax can be used to enter Unicode characters in source code:

"\x{400}".
=> [1024]

This syntax also seems to work in binaries:
<<"\x{00FF}"/utf8>>.
=> <<"ÿ">>

But then it fails when the hex value is greater than FF:
<<"\x{0100}"/utf8>>.
=> ** exception error: bad argument

Is this a bug or intended behavior?

Regards,
Kevin Albrecht



More information about the erlang-bugs mailing list