Bug 493597

Summary: ZWNBSP in result file (critical error)
Product: [Applications] kdiff3 Reporter: Sergey <agibalovsa>
Component: applicationAssignee: michael <reeves.87>
Status: ASSIGNED ---    
Severity: normal CC: pritykin.amir, s.moderow
Priority: NOR    
Version: 1.11.4   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 1.12
Sentry Crash Report:
Attachments: Files and result, and screenshots

Description Sergey 2024-09-24 18:15:36 UTC
Created attachment 174040 [details]
Files and result, and screenshots

SUMMARY
When I merge 3 files the result is "ZWNBSP" characters which are not in the original files.

STEPS TO REPRODUCE
1.  Select file1.txt
2.  Select file2.txt
3. Select file3.txt
4. Check Combine
5. Select result file

OBSERVED RESULT
The resulting file contains bad characters.

EXPECTED RESULT
The resulting file must contain the same tab and newline characters as the source files.


SOFTWARE/OS VERSIONS
Windows:  10

ADDITIONAL INFORMATION
Comment 1 michael 2024-10-16 03:01:47 UTC
Git commit befbaa8d7a42f4899e04decc740dfb9e48e7d0fc by Michael Reeves.
Committed on 16/10/2024 at 02:45.
Pushed by mreeves into branch '1.11'.

Fix broken merge encoding detection
FIXED-IN:1.11.5

M  +3    -1    src/SourceData.cpp
M  +2    -2    src/SourceData.h
M  +7    -7    src/mergeresultwindow.cpp
M  +1    -1    src/mergeresultwindow.h

https://invent.kde.org/sdk/kdiff3/-/commit/befbaa8d7a42f4899e04decc740dfb9e48e7d0fc
Comment 2 michael 2024-10-16 03:02:06 UTC
Git commit bf576269fe42d7c4832aef60e6ba9b4cc75856d9 by Michael Reeves.
Committed on 16/10/2024 at 03:01.
Pushed by mreeves into branch 'master'.

Fix broken merge encoding detection
FIXED-IN:1.11.5

M  +3    -1    src/SourceData.cpp
M  +2    -2    src/SourceData.h
M  +7    -7    src/mergeresultwindow.cpp
M  +1    -1    src/mergeresultwindow.h

https://invent.kde.org/sdk/kdiff3/-/commit/bf576269fe42d7c4832aef60e6ba9b4cc75856d9
Comment 3 michael 2024-10-17 14:24:30 UTC
*** Bug 489538 has been marked as a duplicate of this bug. ***
Comment 4 Viacheslav 2024-11-03 22:39:46 UTC
Hello! Do you have an estimate for when version 1.11.5 will be released with this fix?
Comment 5 michael 2024-11-07 15:05:33 UTC
Working on that now. Should be up within 24 to 48 hrs.
Comment 6 Viacheslav 2024-11-22 03:30:28 UTC
Unfortunately, the fix does not work for me as I just reproduced the issue with Version 1.11.5 (64 bit) on MacOS
Comment 7 Viacheslav 2024-11-22 03:34:52 UTC
As a workaround, I added a custom command in Fork at a file level with the following content: perl -i -CSD -pe 's/\x{FEFF}//g' "${file}"
Comment 8 Sergey 2024-11-22 05:53:54 UTC
Hello everyone.
The fix in version 1.11.5 doesn't work.
Comment 9 michael 2024-11-23 18:16:58 UTC
It likes extra BOM markers are being added. That has been corrected in 1.12/master. UTF-8 without BOM should work as expected for output in 1.11.x. This can be manually set as 'UTF-8' in kdiff3's interface.