Bug 445015 - Unsuccessful "View in another encoding" is remembered by Kate after reopening the file
Summary: Unsuccessful "View in another encoding" is remembered by Kate after reopening...
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: encoding (show other bugs)
Version: 21.12.0
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 12:38 UTC by soshial
Modified: 2021-12-23 09:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Step 1: open the file (encoded in cp1251) (165.20 KB, image/webp)
2021-11-05 12:38 UTC, soshial
Details
Step 2: switch to Unicode (193.32 KB, image/webp)
2021-11-05 12:39 UTC, soshial
Details
Step 3: Kate returns error after switch to Unicode (223.88 KB, image/webp)
2021-11-05 12:40 UTC, soshial
Details
Step 4: close Kate and reopen the file (156.50 KB, image/webp)
2021-11-05 12:40 UTC, soshial
Details
A plain-text file in cp1251 encoding for testing. (39.45 KB, text/plain)
2021-12-23 09:08 UTC, soshial
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soshial 2021-11-05 12:38:48 UTC
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
Comment 1 soshial 2021-11-05 12:39:23 UTC
Created attachment 143239 [details]
Step 2: switch to Unicode
Comment 2 soshial 2021-11-05 12:40:01 UTC
Created attachment 143240 [details]
Step 3: Kate returns error after switch to Unicode
Comment 3 soshial 2021-11-05 12:40:20 UTC
Created attachment 143241 [details]
Step 4: close Kate and reopen the file
Comment 4 Thomas Surrel 2021-12-22 12:09:14 UTC
Hi ! Could you attach an cp1251 encoded example ?
Comment 5 soshial 2021-12-23 09:08:09 UTC
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.