Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

Character Encoding

Open ThiloL opened this issue 6 years ago • 3 comments

Can Get-SFTPChildItem handle path names in ISO8859-1 encoding? FileZilla has an connection option: image

I think there is a Encoding property in the SSH.Net's connection info object.

ThiloL avatar May 31 '18 10:05 ThiloL

To be honest, no clue. Never tested that

Sent from my iPhone

On May 31, 2018, at 6:22 AM, ThiloL [email protected] wrote:

Can Get-SFTPChildItem handle path names in ISO8859-1 encoding? FileZilla has an connection option:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

darkoperator avatar May 31 '18 11:05 darkoperator

In the ConnectionInfo class there is the encoding property. You could make it accessible..

public class ConnectionInfo : IConnectionInfoInternal, IConnectionInfo
    {
        public ConnectionInfo(string host, string username, params AuthenticationMethod[] authenticationMethods);
        public ConnectionInfo(string host, int port, string username, params AuthenticationMethod[] authenticationMethods);
        public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods);

        public Encoding Encoding { get; set; }
        public int RetryAttempts { get; set; }
        public int MaxSessions { get; set; }

ThiloL avatar May 31 '18 11:05 ThiloL

I've tested $session.Session.ConnectionInfo.Encoding = [System.Text.Encoding]::GetEncoding($myencoding) method for file listings - it works, May be it also will work for file names in transfer

MVKozlov avatar May 20 '20 12:05 MVKozlov