diff options
author | Siri Hansen <[email protected]> | 2013-02-21 09:47:22 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-05-14 17:01:54 +0200 |
commit | 45b6ff14ff5a644517ca029fafdae8a63700cd93 (patch) | |
tree | d3924646893edb4d9ac6062851d92b8dcd669ac2 | |
parent | 381bb5a2fd1aabfcf64d09c374a7e9e23d97f2bf (diff) | |
download | otp-45b6ff14ff5a644517ca029fafdae8a63700cd93.tar.gz otp-45b6ff14ff5a644517ca029fafdae8a63700cd93.tar.bz2 otp-45b6ff14ff5a644517ca029fafdae8a63700cd93.zip |
[sasl] Write erl.ini as utf8, allowing unicode path for root dir and bin dir
-rw-r--r-- | lib/sasl/src/release_handler.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl index c1b715b970..5dd84ca521 100644 --- a/lib/sasl/src/release_handler.erl +++ b/lib/sasl/src/release_handler.erl @@ -2205,23 +2205,23 @@ set_static_files(SrcDir, DestDir, Masters) -> write_ini_file(RootDir,EVsn,Masters) -> BinDir = filename:join([RootDir,"erts-"++EVsn,"bin"]), Str0 = io_lib:format("[erlang]~n" - "Bindir=~s~n" + "Bindir=~ts~n" "Progname=erl~n" - "Rootdir=~s~n", + "Rootdir=~ts~n", [filename:nativename(BinDir), filename:nativename(RootDir)]), - Str = re:replace(Str0,"\\\\","\\\\\\\\",[{return,list},global]), + Str = re:replace(Str0,"\\\\","\\\\\\\\",[{return,list},global,unicode]), IniFile = filename:join(BinDir,"erl.ini"), do_write_ini_file(IniFile,Str,Masters). do_write_ini_file(File,Data,false) -> - case do_write_file(File, Data) of + case do_write_file(File, Data, [{encoding,utf8}]) of ok -> ok; Error -> throw(Error) end; do_write_ini_file(File,Data,Masters) -> all_masters(Masters), - safe_write_file_m(File, Data, Masters). + safe_write_file_m(File, Data, [{encoding,utf8}], Masters). %%----------------------------------------------------------------- @@ -2235,13 +2235,15 @@ do_write_ini_file(File,Data,Masters) -> %% (as long as possible), except for 4 which is allowed to fail. %%----------------------------------------------------------------- safe_write_file_m(File, Data, Masters) -> + safe_write_file_m(File, Data, [], Masters). +safe_write_file_m(File, Data, FileOpts, Masters) -> Backup = File ++ ".backup", Change = File ++ ".change", case at_all_masters(Masters, ?MODULE, do_copy_files, [File, [Backup]]) of ok -> case at_all_masters(Masters, ?MODULE, do_write_file, - [Change, Data]) of + [Change, Data, FileOpts]) of ok -> case at_all_masters(Masters, file, rename, [Change, File]) of |