Bug 452659

Summary: Markdown Preview Uses Wrong Encoding
Product: [Applications] kate Reporter: Peter Shkenev <mustela>
Component: plugin-previewAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bizyaev, zawertun
Priority: NOR    
Version First Reported In: 22.04.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot which shows the bug

Description Peter Shkenev 2022-04-15 13:29:51 UTC
Created attachment 148174 [details]
Screenshot which shows the bug

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
***
See attached screenshot

STEPS TO REPRODUCE
1. Open Markdown document with non-ASCII charaters
2. Load Preview plugin
3. Open Preview tab

OBSERVED RESULT
Wrong encoding is used, thus text is unreadable. See attached screenshot

EXPECTED RESULT
Preview uses correct encoding to render the document

SOFTWARE/OS VERSIONS
Windows: 10 21H2 
KDE Frameworks Version: 5.92.0
Qt Version: 5.12.2
Comment 1 Ilya Bizyaev 2022-04-24 22:15:46 UTC
Can reproduce with 22.04.

Operating System: openSUSE Leap 15.3
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2
Comment 2 Christoph Cullmann 2022-05-26 19:59:41 UTC
Git commit 5f423a11b4e45978daa68d019742561b03d83f20 by Christoph Cullmann.
Committed on 26/05/2022 at 19:58.
Pushed by cullmann into branch 'master'.

use UTF-8 encoding

markdown is a relative new format

I would assume the majority of markdown files are
either plain ansi or UTF-8

the old code did use the local encoding,
this leads to issues with unicode files
Related: bug 449942

M  +2    -0    src/markdownpart.cpp

https://invent.kde.org/utilities/markdownpart/commit/5f423a11b4e45978daa68d019742561b03d83f20