Created attachment 143238 [details] Step 1: open the file (encoded in cp1251) SUMMARY After unsuccessful "View in another encoding" file is re-opened STEPS TO REPRODUCE 1. Open a non-Unicode file (for example, Cyrillic encoding CP1251) 2. Choose "View as Unicode -> UTF8". Result: you see an error, the text is garbled and file becomes read-only in the editor 3. Close Kate and reopen the file. OBSERVED RESULT File wasn't changed and the text looks correct (not garbled). But Kate shows that the file encoding is now UTF8. EXPECTED RESULT Since the "View in UTF8 encoding" action resulted in error, the encoding should be cp1251 (as initially it was). SOFTWARE/OS VERSIONS: Operating System: Manjaro Linux KDE Plasma Version: 5.22.5 KDE Frameworks Version: 5.87.0 Qt Version: 5.15.2 Kernel Version: 5.15.0-1-MANJARO (64-bit) Graphics Platform: X11
Created attachment 143239 [details] Step 2: switch to Unicode
Created attachment 143240 [details] Step 3: Kate returns error after switch to Unicode
Created attachment 143241 [details] Step 4: close Kate and reopen the file
Hi ! Could you attach an cp1251 encoded example ?
Created attachment 144796 [details] A plain-text file in cp1251 encoding for testing. Here's the test cp1251 file. It weighs 40 KiB. If it is converted to UTF8, it should become 54 KiB.
Git commit 7f6152b3b0a06469a31bce9b58f3354b481b4542 by Christoph Cullmann. Committed on 15/06/2024 at 17:42. Pushed by cullmann into branch 'master'. don't remember encoding if known to be broken M +2 -2 src/document/katedocument.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/7f6152b3b0a06469a31bce9b58f3354b481b4542