Fix encoding support and send command always encoded as UTF-8

This commit is contained in:
olegkap_cp
2011-09-15 13:21:19 +00:00
parent 234cd1e024
commit 1c8a03abb1
2 changed files with 7 additions and 4 deletions
@@ -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);
}
/// <summary>
@@ -1,4 +1,6 @@
namespace Renci.SshNet.Messages.Connection
using System.Text;
namespace Renci.SshNet.Messages.Connection
{
/// <summary>
/// Represents "exec" type channel request information
@@ -61,7 +63,7 @@
{
base.SaveData();
this.Write(this.Command);
this.Write(this.Command, Encoding.UTF8);
}
}
}