aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-05-28 16:05:40 +0200
committerSiri Hansen <[email protected]>2013-05-28 16:05:40 +0200
commit0ab074b7dece920e8dcd34793b88ce14ca4534ed (patch)
treef2b782c6e25e46e8ce3023769170ca63e5b99c55 /erts/preloaded/src
parent5ad4e9787c072ae8cea1ed1c9f2212551b307267 (diff)
downloadotp-0ab074b7dece920e8dcd34793b88ce14ca4534ed.tar.gz
otp-0ab074b7dece920e8dcd34793b88ce14ca4534ed.tar.bz2
otp-0ab074b7dece920e8dcd34793b88ce14ca4534ed.zip
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).
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/init.erl5
1 files changed, 4 insertions, 1 deletions
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 ->