aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-12 12:34:06 +0200
committerBjörn Gustavsson <[email protected]>2017-04-12 12:34:06 +0200
commit19e9249d960a5b15b4e222efdcb96efbe122853e (patch)
treed97cd1f1af39cbb8690c724bf15b4c4fff27a41f /lib/compiler/src
parent188b7883723a87cacf449f44afe1c362835e203f (diff)
parentb167bfc46cf92cf19527a9cbe2b698b84e1a6156 (diff)
downloadotp-19e9249d960a5b15b4e222efdcb96efbe122853e.tar.gz
otp-19e9249d960a5b15b4e222efdcb96efbe122853e.tar.bz2
otp-19e9249d960a5b15b4e222efdcb96efbe122853e.zip
Merge branch 'bjorn/compiler/unicode-atoms/OTP-14285'
* bjorn/compiler/unicode-atoms/OTP-14285: Correct compile_SUITE:core_roundtrip/1 Atoms in Core Erlang must be encoded in UTF-8
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/core_scan.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/compiler/src/core_scan.erl b/lib/compiler/src/core_scan.erl
index 15bfc78c8b..d7d5f900de 100644
--- a/lib/compiler/src/core_scan.erl
+++ b/lib/compiler/src/core_scan.erl
@@ -283,10 +283,12 @@ scan1([$$|Cs0], Toks, Pos) -> %Character constant
scan1(Cs, [{char,Pos,C}|Toks], Pos1);
scan1([$'|Cs0], Toks, Pos) -> %Atom (always quoted)
{S,Cs1,Pos1} = scan_string(Cs0, $', Pos),
- case catch list_to_atom(S) of
+ try binary_to_atom(list_to_binary(S), utf8) of
A when is_atom(A) ->
- scan1(Cs1, [{atom,Pos,A}|Toks], Pos1);
- _Error -> scan_error({illegal,atom}, Pos)
+ scan1(Cs1, [{atom,Pos,A}|Toks], Pos1)
+ catch
+ error:_ ->
+ scan_error({illegal,atom}, Pos)
end;
scan1([$"|Cs0], Toks, Pos) -> %String
{S,Cs1,Pos1} = scan_string(Cs0, $", Pos),