Question to Transfer Settings Dialog / Replace '\;*...'

Advertisement

MajorTom2004
Joined:
Posts:
7
Location:
Switzerland

Question to Transfer Settings Dialog / Replace '\;*...'

Hi all.
In the WinSCP.ini-file there is a section for every Transfer profile [Configuration\Interface\CopyParam\n], the sections contain (among others)
ReplaceInvalidChars=1
LocalInvalidChars=/%5C:*%3F"<>|
Is there any chance to extend the LocalInvalidChars list in order to replace any special characters, i.e. the single quote? I have tested with adding the single quote ' (without the double quote around it, of course) as well as %27, unfortunately without any effect.
We transfer files from an SFTP server, those files frequently contain (Windows allowed) special characters, however, the downloading system has problems to handle some of them.

I have tried several configurations, WinSCP 5.19.6 and 5.21.7, FTP server running on Linux (I guess, I don't have direct access to that machine), MacOS and Windows. The standard characters as defined in the list are replaced correctly, but not additionally inserted characters.
Thanks,
Thomas

Reply with quote

Advertisement

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

Re: Question to Transfer Settings Dialog / Replace '\;*...'

If I set
LocalInvalidChars=/%5C:*%3F"<>|'
the ' in the downloaded files are replaced with %27, as expected.
. 2023-03-30 08:31:18.112 Transfer done: '/remotepath/quote"'' => 'C:\localpath\quote%22%27' [543]
Make sure your INI file is actually used by your script. Post session log file if you still cannot make it working.

Though better than setting it option in INI file is to set it in the script:
get /remotepath/* C:\localpath\ -rawtransfersettings "LocalInvalidChars=/\:*?\""<>|'"
See https://winscp.net/eng/docs/rawtransfersettings#localinvalidchars

Reply with quote

MajorTom2004
Joined:
Posts:
7
Location:
Switzerland

Re: Question to Transfer Settings Dialog / Replace '\;*...'

Hi Martin.
The solution with the INI file was not successful for me, not even changing to Registry and extending the string there. I have no clue what I am doing wrong, I checked it over and over again ...
However, the get /remotepath/* C:\localpath\ ... solution did work for me, as well as the
$transfer.AddRawSettings in a PowerShell script.

Thank you for your fast response, I appreciate!
Thomas

Reply with quote

MajorTom2004
Joined:
Posts:
7
Location:
Switzerland

Replace UTF8 character

With Ascii characters, the replacement works fine for me. In the meantime, I found a usecase where I need to replace a 3 Byte long UTF8 character, for example 0xE28093 (is it called hyphen?).
I can find no way to build up the LocalInvalidChars string in order to make the replacement work.

Thanks, any help is appreciated.
Thomas

Reply with quote

Advertisement

MajorTom2004
Joined:
Posts:
7
Location:
Switzerland

Re: Replace UTF8 character

Thanks for the answer even if it is not what I hoped for.
Do you plan for the future to implement UTF-8 Multi-Byte or Unicode replacement?

Cheers Thomas

Reply with quote

Advertisement

You can post new topics in this forum