I use XEmacs with the X-Symbol package to edit LaTeX files with cut and paste in XEmacs via the clipboard. At some point, klipper suddenly starts interpreting the text as UTF-8: so any "unrecognised" binary characters (with the top bit set) get replaced by the UTF-8 "replace" character which is the three byte sequence xEF 0xBF 0xBD. For example, the following is a hex dump of "xclip -o" for some XEmacs selected text: 000000: 9a f2 20 9a c8 20 78 .. .. x when klipper gets into this strange state, the above text comes out as: 000000: ef bf bd ef bf bd 20 ef bf bd ...... ... 000010: ef bf bd 20 78 ... x As you can see, the three binary characters have been replaced by the sequence "ef bf bd". Quitting and restarting klipper restores normal functionality: cutting and pasting the same piece of text in the same file now works correctly. Sorry, but I have not been able to find a way to reproduce the problem reliably! If anyone can suggest tests I can apply next time the situation occurs, I would be happy to help. Reproducible: Sometimes Steps to Reproduce: 1. Use XEmacs with X-Symbol to cut/paste binary text 2. Keep working until the problem appears :-( Actual Results: At some point, binary characters (i.e. with the top bit set) start getting replaced by the UTF-8 replace character (the three byte sequence "ef bf bd") Expected Results: Binary characters are preserved "as is" in the clipboard. Restarting klipper fixes the problem: until it occurs again.
More information: The bug manifested itself again today. I tried selecting "Clear clipboard history" in the klipper menu, selecting the text again in XEmacs and pasting it via middle click. The first paste worked (pasting the correct text), but an immediate second paste of the same selection inserted the corrupted text (with binary characters replaced by "ef bf bd" sequences). Restarting klipper fixed it: I can copy and paste the same binary text as often as I want.
This bug is likely for some version of Plasma 4, not 5.15.3. so I'm marking this as resolved unmaintained. If anyone has an issue similar to this one, please make a new report for the latest version of Plasma.