diff --git a/Renci.SshClient/Renci.SshNet/Common/SshData.cs b/Renci.SshClient/Renci.SshNet/Common/SshData.cs index 07f85825..7a441397 100644 --- a/Renci.SshClient/Renci.SshNet/Common/SshData.cs +++ b/Renci.SshClient/Renci.SshNet/Common/SshData.cs @@ -359,8 +359,9 @@ namespace Renci.SshNet.Common if (data == null) throw new ArgumentNullException("data"); - this.Write((uint)data.Length); - this.Write(encoding.GetBytes(data)); + var bytes = encoding.GetBytes(data); + this.Write((uint)bytes.Length); + this.Write(bytes); } /// diff --git a/Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs b/Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs index c624b450..e352071c 100644 --- a/Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs +++ b/Renci.SshClient/Renci.SshNet/Messages/Connection/ChannelRequest/ExecRequestInfo.cs @@ -1,4 +1,6 @@ -namespace Renci.SshNet.Messages.Connection +using System.Text; + +namespace Renci.SshNet.Messages.Connection { /// /// Represents "exec" type channel request information @@ -61,7 +63,7 @@ { base.SaveData(); - this.Write(this.Command); + this.Write(this.Command, Encoding.UTF8); } } }