Skip to content

Commit d885abe

Browse files
committed
Ensure that peer node deals with unicode
Follow-up to #10759 Related to #10194 Related to erlang/otp#8289
1 parent 3fd96a0 commit d885abe

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deps/rabbit/src/rabbit_peer_discovery.erl

+6-4
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ query_node_props(Nodes) when Nodes =/= [] ->
372372
%% By using a temporary intermediate hidden node, we ask Erlang not to
373373
%% connect everyone automatically.
374374
Context = rabbit_prelaunch:get_context(),
375-
VMArgs0 = ["-hidden"],
375+
VMArgs0 = ["+pc","unicode","-hidden"],
376376
VMArgs1 = case init:get_argument(boot) of
377377
{ok, [[BootFileArg]]} ->
378378
["-boot", BootFileArg | VMArgs0];
@@ -455,7 +455,7 @@ maybe_add_inetrc_arguments1(VMArgs, Val) ->
455455
%% The filename argument must be passed as a quoted string so that the
456456
%% command line is correctly parsed as an Erlang string by the temporary
457457
%% hidden node.
458-
ValString = rabbit_misc:format("~0p", [Val]),
458+
ValString = rabbit_misc:format("~0p", [unicode:characters_to_list(Val)]),
459459
["-kernel", "inetrc", ValString | VMArgs].
460460

461461
maybe_add_tls_arguments(VMArgs) ->
@@ -511,7 +511,8 @@ maybe_add_tls_arguments(VMArgs) ->
511511
%% "no_dot_erlang","-hidden"],
512512
VMArgs1 = case init:get_argument(ssl_dist_opt) of
513513
{ok, SslDistOpts0} ->
514-
SslDistOpts1 = [["-ssl_dist_opt" | SslDistOpt]
514+
SslDistOpts1 = [["-ssl_dist_opt" |
515+
unicode:characters_to_list(SslDistOpt)]
515516
|| SslDistOpt <- SslDistOpts0],
516517
SslDistOpts2 = lists:concat(SslDistOpts1),
517518
SslDistOpts2 ++ VMArgs;
@@ -528,7 +529,8 @@ maybe_add_tls_arguments(VMArgs) ->
528529
%% argument list.
529530
VMArgs2 = case init:get_argument(ssl_dist_optfile) of
530531
{ok, [[SslDistOptfileArg]]} ->
531-
["-ssl_dist_optfile", SslDistOptfileArg | VMArgs1];
532+
["-ssl_dist_optfile",
533+
unicode:characters_to_list(SslDistOptfileArg) | VMArgs1];
532534
_ ->
533535
VMArgs1
534536
end,

0 commit comments

Comments
 (0)