How to transfer Simpled Chinese file correctly with console?

Advertisement

lottiwang
Joined:
Posts:
5

How to transfer Simpled Chinese file correctly with console?

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.

Reply with quote

Advertisement

lottiwang
Joined:
Posts:
5

Latest version feedback

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: How to transfer Simpled Chinese file correctly with console?

/rawsetting was instrduced only in the 5.0.2 beta. Make sure you upgrade.

Reply with quote

lottiwang
Joined:
Posts:
5

Re: How to transfer Simpled Chinese file correctly with console?

martin 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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: How to transfer Simpled Chinese file correctly with console?

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"

Reply with quote

Advertisement

lottiwang
Joined:
Posts:
5

Re: How to transfer Simpled Chinese file correctly with console?

martin 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.

Reply with quote

Advertisement

You can post new topics in this forum