From 0ab074b7dece920e8dcd34793b88ce14ca4534ed Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 28 May 2013 16:05:40 +0200 Subject: Allow unicode characters for boot and config in init:make_permanent When release_handler makes a release permanent, it calls init:make_permanent/2 in order to set the path to the config and boot file. The paths are coverterd to binaries, and this commit changes this conversion from using lists_to_binary/1 to using unicode:characters_to_binary/3 with the encoding set according to the file name encoding mode (+fnu/fna/fnl). --- erts/preloaded/src/init.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/preloaded/src') diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl index 87003d096b..ab8464956c 100644 --- a/erts/preloaded/src/init.erl +++ b/erts/preloaded/src/init.erl @@ -465,7 +465,10 @@ make_permanent(Boot,Config,Flags0,State) -> set_flag(_Flag,false,Flags) -> {ok,Flags}; set_flag(Flag,Value,Flags) when is_list(Value) -> - case catch list_to_binary(Value) of + %% The flag here can be -boot or -config, which means the value is + %% a file name! Thus the file name encoding is used when coverting. + Encoding = file:native_name_encoding(), + case catch unicode:characters_to_binary(Value,Encoding,Encoding) of {'EXIT',_} -> {error,badarg}; AValue -> -- cgit v1.2.3