Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Input to has to be in ansi encoding. I do not know VB.Net to show you how to do that.

Sorry to get back to this topic.
But I have still problems.

in the following example I am not able to send a file with special characters or from a local directory with special characters.


str_HOST = "test@testhost"
str_File = "TEC_20100615.txt""
str_SourceDir = "D:\TxdRxD\BERGABE_TEC\"
str_TargetDir = "/cygdrive/c/Inetpub/sftp/"

Const LogName As String = "_sftplog.xml"

str_ResultStr = ""

'even the next steps do not help because str_targetdir is
'again automatically converted into Unicode16

'Dim b_sourcedir() = Encoding.UTF8.GetBytes(str_SourceDir)
'str_SourceDir = Encoding.Default.GetString(b)

'Dim b_targetdir = Encoding.UTF8.GetBytes(str_TargetDir)
'str_TargetDir = Encoding.Default.GetString(b)

Dim winscp As Process = New Process()
winscp.StartInfo.FileName = ""
winscp.StartInfo.Arguments = "/log=" + LogName
winscp.StartInfo.UseShellExecute = False
winscp.StartInfo.RedirectStandardInput = True
winscp.StartInfo.RedirectStandardOutput = True
winscp.StartInfo.CreateNoWindow = True

' Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch abort")
winscp.StandardInput.WriteLine("option confirm off")
If str_User = "" Then
winscp.StandardInput.WriteLine("open " & str_HOST)
winscp.StandardInput.WriteLine("open " & str_User & ":" & str_Password & "@" & str_HOST & IIf(str_PrivateKeyFile <> "", " -privatekey=" & str_PrivateKeyFile, ""))
End If

winscp.StandardInput.WriteLine("option transfer binary")
winscp.StandardInput.WriteLine("put """ & str_SourceDir & str_File & """ """ & str_TargetDir & """")
'winscp.StandardInput.WriteLine("ls " & TargetDir)

Dim output As String = winscp.StandardOutput.ReadToEnd()


The logfile:

<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="" name="ftpuser@wsgodi" start="2010-08-03T08:21:03.039Z">
<filename value="D:\TxdRxD\_BERGABE_TEC\TEC_20100615.txt" />
<result success="false">
<message>Datei oder Verzeichnis &quot;D:\TxdRxD\_BERGABE_TEC\TEC_20100615.txt&quot; existiert nicht.</message>
<message>System Fehler. Code: 3.
Das System kann den angegebenen Pfad nicht finden</message>

So for me it is unclear how to post parameters like filenames or directories with special characters to
Reading the xml result is OK...

Thanks for the help.


Re: Special Characters (German) are changed

Yes thats the problem,

I will switch to XML Logging.

Thank you for your help.


Re: Special Characters (German) are changed

So you capture output of the console? Are you aware that Windows console uses different encoding (not Ansi)? You may better try to use XML logging.

Re: Special Characters (German) are changed

martin wrote:

are the wrong characters just shown on the console window?

After the download the files themselves are correct.

I am using the ls command to get a file list to compare this with a database.

So the problem is: the names with this special characters will not fit...

Thank you for your help.


Re: Special Characters (German) are changed

DGorthat wrote:

Is there a difference between winscp.exe and

Well, yes and no. may have possibly problems displaying the special characters correctly. But it saves the file exactly as winscp.exe. So are the files indeed creates with wrong characters or are the wrong characters just shown on the console window?

Re: Special Characters (German) are changed

Thanks for your help.

Is there a difference between winscp.exe and

winscp.exe displays and copys the files correktly using drag and drop. leads to the problem.
Both versions use the same stored session.

I tried both settings for UTF8 conversion with the same result for the
Winscp.exe ran into a problem when I set UTF-8 conversion it to ON.
It even did not show all files. Starting the connection I get an error message:
"Whrend der Dekodierung einer UTF-8 Zeichenkette ist ein Fehler aufgetreten."
short: Error dekoding an UTF-8 character string

Files with special characters even do not appear in the directorystructure.

For I did not see a difference.


Re: Special Characters (German) are changed

Please read FAQ. If that does not help, come back.

Special Characters (German) are changed

Hello together,

I am running winscp 4.2.1 in scripting mode with german translation on a windows xp SP3 German.

The logs or even filenames with special characters show special characters that do not fit to the original ones.

like: instead of
instead of
instead of
instead of

That happens only with the so the translation seems to be fine.

Here a part of a log of a sinchronization:

Lokal 'D:\TxdRxD\Datei' <= Entfernt '/cygdrive/c/Inetpub/sftp'
'D:\TxdRxD\Datei\LISTE_tcc_20100519_01.dat.gz' gelscht
'D:\TxdRxD\Datei\VR' gelscht

My editor shows codepage 1252

For logging that should not be a problem, but when I use the ls command to select a file [edit] with this characters [/edit] for download that causes the problem that the file can not be found.

Is there any setting in winscp to solve this? Or is that a windows internal problem?