I'm using a PowerShell script (I've seen on this Forum similar posts using the same base PowerShell script) to Sync Directories (
.SynchronizeDirectories) but I'm having a problem with character encoding.
I'm from Portugal and we use accents and other special characters when writing, so it's normal for user to use those characters on file and folder names.
If I connect to my remote host (Linux based) with WinSCP and set the UTF-8 Encoding from "Auto" to "On", the remote files and folders are shown correctly with accents and other special characters (like
ç); with "Auto" the "special" characters become garbage.
My first PowerShell script used the
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftpbut my local files and folder names with special characters become garbage. My second attempt was to find if there was an option to set the UTF-8 Encoding to "On" on the
SessionClass but there's none. I've also read something on the Forum about the ability to use UTF with the protocols Sftp and Scp; so I've switched the protocol to Scp (
$sessionOptions.Protocol = [WinSCP.Protocol]::Scp) but also the same result.