Bug 508782 - Dolphin on Windows replaces \n with \r\n even in binary files, corrupting executables
Summary: Dolphin on Windows replaces \n with \r\n even in binary files, corrupting exe...
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: FTP (other bugs)
Version First Reported In: 6.16.0
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-26 20:47 UTC by ratijas
Modified: 2025-08-27 19:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?