Skip to content

Commit

Permalink
fix: re:run does not work with unicode char list
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed Jul 3, 2024
1 parent edff64c commit cf419ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hocon_tconf.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ get_map_key_name_validator(_NameType) ->
fun default_map_key_name_validator/1.

default_map_key_name_validator(Name) ->
case re:run(Name, ?MAP_KEY_RE) of
case re_run(Name, ?MAP_KEY_RE) of
nomatch ->
{error, #{
expected_data_type => ?MAP_KEY_RE,
Expand All @@ -1352,6 +1352,9 @@ default_map_key_name_validator(Name) ->
end
end.

re_run(Str, Pattern) ->
re:run(unicode:characters_to_binary(Str, utf8), Pattern).

fmt_field_names(Names) ->
do_fmt_field_names(lists:sort(lists:map(fun str/1, Names))).

Expand Down

0 comments on commit cf419ff

Please sign in to comment.