This project is read-only.

send special character in command

Sep 15, 2011 at 11:47 AM


is it possible to send special character in a command?

Like this: 


var cmd = sshClient.CreateCommand("touch /tmp/test/testkköäüt",Encoding.UTF8);

The createt File will contain questionmarks instead of öäü (testkk???t). What am I doing wong?


Sep 15, 2011 at 2:26 PM

I currently did some fix, to handle characters other then ascii so you might want to download latest versions of the code.

Also, I tried to run similar command here and it worked now, but now it translates everything into UTF-8 so if you have not ascii characters it will be sent as UTF-8.


See if it works for you and let me know.


I am not so familiar with international support on unix so I dont know how much I could help there.




Sep 15, 2011 at 7:20 PM


great work!!!
It seems to work for me.


Apr 13, 2012 at 7:55 AM

Hi olegkap,

i am searching for library, which will be able to configure the connection to interpret different encoding on the server.
I noticed that CreateCommand uses Renci.SshNet.Common.ASCIIEncoding only.

Is there any other way how to configure custom server encoding for connection?

And what is the purpose of custom ASCII encoding class, which replaces the System.Text.Encoding.ASCII?

Apr 13, 2012 at 1:41 PM



Yes, you can provide your own encoding if you wish. You can pass your encoding to CreateCommand as second parameter.

The reason I have custom ASCIIEncoding is to provide support Silverlight and WindowsPhone versions since this class is not available in that runtime.