diff options
author | Siri Hansen <[email protected]> | 2013-05-28 16:05:40 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-05-28 16:05:40 +0200 |
commit | 0ab074b7dece920e8dcd34793b88ce14ca4534ed (patch) | |
tree | f2b782c6e25e46e8ce3023769170ca63e5b99c55 | |
parent | 5ad4e9787c072ae8cea1ed1c9f2212551b307267 (diff) | |
download | otp-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).
-rw-r--r-- | erts/preloaded/src/init.erl | 5 |
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 -> |