Bug 450225 - DOS line endings are not correctly detected with files encoded in UTF-8 with BOM
Summary: DOS line endings are not correctly detected with files encoded in UTF-8 with BOM
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (show other bugs)
Version: 1.9.4
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-14 15:00 UTC by JaumeGreen
Modified: 2022-02-23 22:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 1.9.5
Sentry Crash Report:


Attachments
Attached sample files, one with the problematic encoding, second one with a encoding that works. (438 bytes, application/x-zip-compressed)
2022-02-14 15:00 UTC, JaumeGreen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JaumeGreen 2022-02-14 15:00:56 UTC
Created attachment 146716 [details]
Attached sample files, one with the problematic encoding, second one with a encoding that works.

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Similar to bug 442199, but with files encoded in UTF-8 with BOM.
It happens even if only one of them is like this.

STEPS TO REPRODUCE
1.  Have a couple of files encoded in UTF-8 with BOM, with CRLF as end of file.
2.  Compare them.

OBSERVED RESULT
Extra lines are shown. Application thinks that the line end style is Unix.

EXPECTED RESULT
No extra lines shown.

SOFTWARE/OS VERSIONS
Windows: Windows 10 Pro , build 19042.1526

ADDITIONAL INFORMATION
Comment 1 michael 2022-02-23 22:26:56 UTC
Git commit 4f14cfb9efd58e1ebe22e1d4e126b779018a21c0 by Michael Reeves.
Committed on 23/02/2022 at 21:32.
Pushed by mreeves into branch 'master'.

Fix EOL detection issues

Use QStream::read to read next character for EOL detection
Avoid QStream::pos due to severe speed issues
Related: bug 448353
FIXED-IN:1.9.5

M  +14   -12   src/SourceData.cpp
M  +87   -1    src/autotests/datareadtest.cpp

https://invent.kde.org/sdk/kdiff3/commit/4f14cfb9efd58e1ebe22e1d4e126b779018a21c0
Comment 2 michael 2022-02-23 22:28:04 UTC
Git commit ac247986d4d24bb28cfc112d58e3d0a808057b1a by Michael Reeves.
Committed on 23/02/2022 at 21:35.
Pushed by mreeves into tag '1.9.5'.

Fix EOL detection issues

Use QStream::read to read next character for EOL detection
Avoid QStream::pos due to severe speed issues
Related: bug 448353
FIXED-IN:1.9.5

M  +14   -11   src/SourceData.cpp

https://invent.kde.org/sdk/kdiff3/commit/ac247986d4d24bb28cfc112d58e3d0a808057b1a
Comment 3 michael 2022-02-23 22:37:13 UTC
Git commit 96cc89bec01f14bf5fc980e6ae250ffebbd7164f by Michael Reeves.
Committed on 23/02/2022 at 22:33.
Pushed by mreeves into branch '1.9'.

Fix EOL detection issues

Use QStream::read to read next character for EOL detection
Avoid QStream::pos due to severe speed issues
Related: bug 448353
FIXED-IN:1.9.5

M  +14   -11   src/SourceData.cpp

https://invent.kde.org/sdk/kdiff3/commit/96cc89bec01f14bf5fc980e6ae250ffebbd7164f