Topic "Special Characters (German) are changed"

Author Message
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
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 winscp.com so the translation seems to be fine.

Here a part of a log of a sinchronization:

Synchronisiere...
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?

Dirk
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
Thanks for your help.

Is there a difference between winscp.exe and winscp.com?

winscp.exe displays and copys the files correktly using drag and drop.
winscp.com 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.com.
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 winscp.com I did not see a difference.

Dirk
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
DGorthat wrote:
Is there a difference between winscp.exe and winscp.com?

Well, yes and no. winscp.com 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 winscp.com console window?
_________________
Martin Prikryl
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
prikryl wrote:
are the wrong characters just shown on the winscp.com 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.

Dirk
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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.
_________________
Martin Prikryl
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
Yes thats the problem,

I will switch to XML Logging.

Thank you for your help.

Dirk
DGorthat
[View user's profile]

Joined: 2009-02-03
Posts: 15
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.

Parameters:

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.com"
winscp.StartInfo.Arguments = "/log=" + LogName
winscp.StartInfo.UseShellExecute = False
winscp.StartInfo.RedirectStandardInput = True
winscp.StartInfo.RedirectStandardOutput = True
winscp.StartInfo.CreateNoWindow = True
winscp.Start()

' 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)
Else
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)
winscp.StandardInput.Close()

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

winscp.WaitForExit()


The logfile:

<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="ftpuser@wsgodi" start="2010-08-03T08:21:03.039Z">
<upload>
<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>
</result>
</upload>
</session>



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

Thanks for the help.

Dirk
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Input to winscp.com has to be in ansi encoding. I do not know VB.Net to show you how to do that.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License