Wrong characters in filenames with accents when transferring from french Windows to Linux using Wi

Advertisement

cedric974
Joined:
Posts:
1
Location:
Reunion

Wrong characters in filenames with accents when transferring from french Windows to Linux using Wi

Hello,
I'm using WinSCP on a Windows 11 (French locale) computer. When I transfer files whose names contain accented characters (é, è, à, ç, …) to a Linux server (which uses UTF-8), the filenames end up with weird or corrupted characters instead of the accents.

The Linux filesystem itself is configured in UTF-8 and works fine. If I connect via SSH (PuTTY) and list the files, I see ? or garbled characters in place of the accents.

I don't want to change the Linux encoding (it must stay in UTF-8). I only want WinSCP to correctly handle the filename encoding when uploading from Windows.

How can I configure WinSCP to do this?

Thanks a lot!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,398
Location:
Prague, Czechia

Re: Wrong characters in filenames with accents when transferring from french Windows to Linux using Wi

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

zxmon21
Joined:
Posts:
3
Location:
Sweden

I see the same issue with German Umlauts. I'm attaching a screenshot of an ls of the same directory with WinSCP 7.5.3 build 16364 (left) and PuTTY 0.83 (right).
The problematic directories were created from WinSCP with recent versions. They look right in WinSCP, but WinSCP can't copy files to them from local. These folders look wrong in PuTTY, Qfile client on mobile and QNAP web interface.
Older folders look right in QNAP web interface, PuTTY, Qfile client on mobile, but wrong on recent WinSCP.

Linux [xxxx] 5.10.60-qnap #1 SMP Tue Jul 15 03:59:56 CST 2025 x86_64 GNU/Linux

Screenshot WinSCP left Putty right.png

Reply with quote

zxmon21
Joined:
Posts:
3
Location:
Sweden

Here I'm createing one folder with umlaut, and copy a file from local to that folder. Fails with error.
Here I'm createing one folder WITHOU umlaut, and copy a file from local to that folder. Works fine.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
42,398
Location:
Prague, Czechia

@zxmon21: Thanks for all the details.
This is the problem:
. 2025-09-26 09:17:45.401 Listing directory "/share/CACHEDEV5_DATA/Multimedia/Audiobooks Deutsch".
> 2025-09-26 09:17:45.401 Type: SSH_FXP_OPENDIR, Size: 60, Number: 779
< 2025-09-26 09:17:45.433 Type: SSH_FXP_HANDLE, Size: 13, Number: 779
> 2025-09-26 09:17:45.433 Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< 2025-09-26 09:17:45.433 Type: SSH_FXP_NAME, Size: 12700, Number: 1036
> 2025-09-26 09:17:45.433 Type: SSH_FXP_READDIR, Size: 13, Number: 1292
< 2025-09-26 09:17:45.555 Type: SSH_FXP_STATUS, Size: 28, Number: 1292
< 2025-09-26 09:17:45.555 Status code: 1
. 2025-09-26 09:17:45.555 Strings received in non-UTF-8 encoding in a previous packet, will not use UTF-8 anymore
There's probably some broken filename in the Audiobooks Deutsch folder. If you post log with logging level set to Debug 2, I can look further.

In any case, you can override this by setting "UTF-8 encoding for filenames" to On:
https://winscp.net/eng/docs/ui_login_environment

Btw, when you wrote "wrong on recent WinSCP", did you mean that it works with some old version of WinSCP?

Reply with quote

Advertisement

zxmon21
Joined:
Posts:
3
Location:
Sweden

Excellent, thanks for pointing that out. I changed from UTF-8 AUTO to UTF-8 ON in the site settings. I had to delete some broken-looking folder names using command line, but now WinSCP is working again, and the folder looks like it should.

Regarding "recent" version: I did notice the problem occurring only recently (i.e. I was using a recent WinSCP). I haven't compared to see if it occurs with an older version. So "recent" may be my misinterpretation :)

Reply with quote

Advertisement

You can post new topics in this forum