Bug 508782

Summary: Dolphin on Windows replaces \n with \r\n even in binary files, corrupting executables
Product: [Frameworks and Libraries] frameworks-kio Reporter: ratijas <me>
Component: FTPAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: major CC: kdedev, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 6.16.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description ratijas 2025-08-26 20:47:20 UTC
SUMMARY

Dolphin/KIO on Windows transfer files from ftp/sftp what seems to be called FTP ASCII mode, whereby UNIX line breaks \n are automatically replaced with \r\n when copying from server to local.

This is cool for text files, as it makes them fully usable and compatible on the target/local Windows system, but unfortunately not so cool for everything else: binary files, namely media, executable etc.


STEPS TO REPRODUCE

1. Open remote connection to your server via sftp.
2. Copy any file to local machine. Since Drag&Drop is broken/disfunctional, use Ctrl+C / Ctrl+V actions.


OBSERVED RESULT

Executable file is broken due to all 0x0a (\n) bytes in it were replaced with 0x0d 0x0a (\r\n).


EXPECTED RESULT

Binary files should be copied as-is.


SOFTWARE/OS VERSIONS
Dolphin: 25.11.70
KDE Frameworks: 6.16.0
Qt: Using 6.8.3 and built against 6.8.3
Windows 11 Version 24H2
Build ABI: x86_64-little_endian-llp64
Kernel: winnt 10.0.26100


ADDITIONAL INFORMATION

https://www.jscape.com/blog/ftp-binary-and-ascii-transfer-types-and-the-case-of-corrupt-files

The scp command does not mess with ASCII mode replacements.
A popular GUI app WinSCP doesn't mess with it either.
So why should Dolphin/KIO bother?