Skip to content

Commit d1b3c43

Browse files
committed
Support non-latin1 atoms, broken in 67c8fdf (processone/ejabberd#4369)
1 parent a1275d5 commit d1b3c43

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/yconf.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,9 @@ read_include_files(Includes, Opts, Paths) ->
975975
%%%===================================================================
976976
-spec to_binary(term()) -> binary().
977977
to_binary(A) when is_atom(A) ->
978-
atom_to_binary(A, latin1);
978+
try erlang:atom_to_binary(A, latin1)
979+
catch _:badarg -> erlang:atom_to_binary(A, utf8)
980+
end;
979981
to_binary(B) when is_binary(B) ->
980982
B;
981983
to_binary(Bad) ->

0 commit comments

Comments
 (0)