aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-11 13:55:20 +0200
committerBjörn Gustavsson <[email protected]>2017-04-12 12:28:56 +0200
commit4402730cead48757d8086c388acbd86366d291a1 (patch)
treea554f793d9c9fa04c865900d3d18b73441ece310 /lib/compiler
parenta7307600a2b8dbcf628ae8ccf26137bc32f060cc (diff)
downloadotp-4402730cead48757d8086c388acbd86366d291a1.tar.gz
otp-4402730cead48757d8086c388acbd86366d291a1.tar.bz2
otp-4402730cead48757d8086c388acbd86366d291a1.zip
Atoms in Core Erlang must be encoded in UTF-8
core_scan will now support and require atoms encoded in UTF-8.
Diffstat (limited to 'lib/compiler')
-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),