aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sftp.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-01-17 15:57:21 +0100
committerHans Nilsson <[email protected]>2014-01-21 16:36:38 +0100
commitf4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0 (patch)
treed69a0f448f831ac73ba08d09dbfdaacbb4d99a0c /lib/ssh/src/ssh_sftp.erl
parentf836096cb383c6a3c5c91956ded5bd4e2772bcd2 (diff)
downloadotp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.tar.gz
otp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.tar.bz2
otp-f4c9b4a4dddcf1f577df3f4bf58f2f7184cae6b0.zip
ssh: Adds unicode
Diffstat (limited to 'lib/ssh/src/ssh_sftp.erl')
-rw-r--r--lib/ssh/src/ssh_sftp.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index 10167a9223..0ea2366ac7 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -352,7 +352,7 @@ write_file(Pid, Name, List) ->
write_file(Pid, Name, List, ?FILEOP_TIMEOUT).
write_file(Pid, Name, List, FileOpTimeout) when is_list(List) ->
- write_file(Pid, Name, list_to_binary(List), FileOpTimeout);
+ write_file(Pid, Name, unicode:characters_to_binary(List), FileOpTimeout);
write_file(Pid, Name, Bin, FileOpTimeout) ->
case open(Pid, Name, [write, binary], FileOpTimeout) of
{ok, Handle} ->
@@ -514,7 +514,7 @@ do_handle_call({pread,Async,Handle,At,Length}, From, State) ->
case get_mode(Handle, State2) of
binary -> {{ok,Data}, State2};
text ->
- {{ok,binary_to_list(Data)}, State2}
+ {{ok,unicode:characters_to_list(Data)}, State2}
end;
(Rep, State2) ->
{Rep, State2}
@@ -535,8 +535,7 @@ do_handle_call({read,Async,Handle,Length}, From, State) ->
fun({ok,Data}, State2) ->
case get_mode(Handle, State2) of
binary -> {{ok,Data}, State2};
- text ->
- {{ok,binary_to_list(Data)}, State2}
+ text -> {{ok,binary_to_list(Data)}, State2}
end;
(Rep, State2) -> {Rep, State2}
end);