diff options
author | Dan Gudmundsson <[email protected]> | 2013-04-18 14:55:47 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2013-05-20 13:36:27 +0200 |
commit | ee23d4b549618044d4a4f800db839483b359cb9f (patch) | |
tree | d7527dfddaf63d98f0662c8e93f66ef8a4f89436 /lib/sasl/src | |
parent | c7cda78643561ac76e108d37a91eeb67f899696a (diff) | |
download | otp-ee23d4b549618044d4a4f800db839483b359cb9f.tar.gz otp-ee23d4b549618044d4a4f800db839483b359cb9f.tar.bz2 otp-ee23d4b549618044d4a4f800db839483b359cb9f.zip |
erts: Windows, convert erlsrv to use widestring
Diffstat (limited to 'lib/sasl/src')
-rw-r--r-- | lib/sasl/src/erlsrv.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sasl/src/erlsrv.erl b/lib/sasl/src/erlsrv.erl index 67f6941479..711c1c6f1c 100644 --- a/lib/sasl/src/erlsrv.erl +++ b/lib/sasl/src/erlsrv.erl @@ -30,7 +30,7 @@ erlsrv(EVer) -> Root = code:root_dir(), - "\"" ++ filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]) ++ "\"". + filename:join([Root, "erts-" ++ EVer, "bin", "erlsrv.exe"]). current_version() -> hd(string:tokens(erlang:system_info(version),"_ ")). @@ -71,11 +71,14 @@ write_all_data(Port,[]) -> Port ! {self(), {command, io_lib:nl()}}, ok; write_all_data(Port,[H|T]) -> - Port ! {self(), {command, H ++ io_lib:nl()}}, + Port ! {self(), {command, unicode:characters_to_binary([H,io_lib:nl()])}}, write_all_data(Port,T). read_all_data(Port) -> - lists:reverse(read_all_data(Port,[],[])). + Data0 = lists:reverse(read_all_data(Port,[],[])), + %% Convert from utf8 to a list of chars + [unicode:characters_to_list(list_to_binary(Data)) || Data <- Data0]. + read_all_data(Port,Line,Lines) -> receive {Port, {data, {noeol,Data}}} -> @@ -178,7 +181,7 @@ get_service(EVer, ServiceName) -> [] end end, - %%% First split by Env: + %%% First split by Env: {Before, After} = split_by_env(Data), FirstPass = lists:flatten(lists:map(F,Before)), %%% If the arguments are there, split them to |