Topic "How to transfer Simpled Chinese file correctly with console?"

Author Message
lottiwang
[View user's profile]

Joined: 2011-09-21
Posts: 5
I have some files to transfer to remote host,but the filename are all Simpled Chinese characters.
I use command [winscp.com /script="script.txt"] ,and the content of script.txt followed:

~~~~~~~
open sftp://perlog:passwd@10.1.163.20:36000
put *.csv
exit
~~~~~~~

when finished,all filenames can't be displayed correctly,they are garbled.
Advertisements
lottiwang
[View user's profile]

Joined: 2011-09-21
Posts: 5
I have tried to store a session and use /rawsetting utf=1 to force the charset as utf-8.
winscp.exe /console /open perflog /rawsettings utf=1

But when I try to open,it shows "Too many arguments...",it seems /rawsettings doesn't work?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
/rawsetting was instrduced only in the 5.0.2 beta. Make sure you upgrade.
_________________
Martin Prikryl
lottiwang
[View user's profile]

Joined: 2011-09-21
Posts: 5
prikryl wrote:
/rawsetting was instrduced only in the 5.0.2 beta. Make sure you upgrade.


I did upgrade to 5.0.2 beta.But it is not what I want.

So,I downloaded the source code and spent one day to read it and finally I added a line code in core/SecureShell.cpp at line 33,the constructor of class TSecureShell,follwing the modified code:

__fastcall TSecureShell::TSecureShell(TSessionUI* UI,
TSessionData * SessionData, TSessionLog * Log, TConfiguration * Configuration)
{
FUI = UI;
FSessionData = SessionData;
//add by lottiwang
FSessionData->NotUtf=asOff;
//add end
FLog = Log;
....
}
forced the utf support swith to On.Then rebuild the project,and the winscp.com works well when transfering Simpled Chinese file.

Any way,Thanks a lot.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Thanks for your post.

Though I believe that your change to the source code has the same effect as rawsettings Utf=1

Maybe you just have the syntax wrong. Have you tried:
winscp.com /command "open perflog -rawsettings Utf=1"
_________________
Martin Prikryl
lottiwang
[View user's profile]

Joined: 2011-09-21
Posts: 5
prikryl wrote:
Thanks for your post.

Though I believe that your change to the source code has the same effect as rawsettings Utf=1

Maybe you just have the syntax wrong. Have you tried:
winscp.com /command "open perflog -rawsettings Utf=1"


I re-downloaded the latest build 5.0.2,and tried again.
It seems I have to store a session first,isn't it?
with my change,I do not have to store a session.

I tried to execute the following command:
D:\winscp5>WinSCP.com /command "open sftp://perflog:mypwd@10.1.164.107:360
00 -rawsettings Utf=1"
Too many parameters for command 'open'.

I don't want to save a session because the password can't be shown.otherwise everyone can login with winscp.exe.

maybe you can add a new feature in next build.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Thanks for spotting this.
I have added this bug to the tracker:
http://winscp.net/tracker/show_bug.cgi?id=740
lottiwang
[View user's profile]

Joined: 2011-09-21
Posts: 5
prikryl wrote:
Thanks for spotting this.
I have added this bug to the tracker:
http://winscp.net/tracker/show_bug.cgi?id=740


Thanks.I am so glad that I can do something for Winscp.
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