SUMMARY *** while writing Persian/Arabic text, zero-width joiner (u+200D) and zero-width non-joiner (u+200C) characters are ignored while typing in text tool. however, if you paste a text containing those characters into text tool, it is shown correctly and the problem is only when typing. these two characters are important in writing Persian and Arabic text. *** STEPS TO REPRODUCE 1. type a Persian or Arabic text using text tool containing one of ZWNJ or ZWJ characters. for instance: "آدمها". (for inserting those characters, hit shift+space and backtick key (the key in the left of 1) in Persian keyboard layout) 2. see the result OBSERVED RESULT these characters are ignored. in this example, you will see "آدمها" instead of "آدمها". EXPECTED RESULT these characters should be written in the text. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.24.5 ADDITIONAL INFORMATION this problem only occurs while typing text. I have tried it on KDE neon 5.25 too. same result.
I think I see the problem in the code (it checks for "isPrint" on characters added). However, since I'm not having a hardware Persian keyboard, only a german one which I switch to Persian layout, and can not read the arabic text, I'm not sure how to verify my fix. Can you give me a key-by-key instruction how to check if my fix works ? Or can I send you a patch and you test it ?
(In reply to Martin Koller from comment #1) > Can you give me a key-by-key instruction how to check if my fix works ? in Persian layout, shift+space makes a ZWNJ and Backtick makes a WNJ if you press there keys: (D, shift+space, D) you should see this if everything is OK: یی, otherwise, you will see this: یی if you press these keys: (D, `) you should see this if everything is OK: یـ, otherwise, you will see this: ی > Or can I send you a patch and you test it ? yes, please send me the patch.
Great, thanks. With this description I could see that my fix works indeed.
Git commit 297feb5453c2ea7d3b27e9e5717211841fe20ac8 by Martin Koller. Committed on 10/07/2022 at 15:50. Pushed by mkoller into branch 'master'. Only disallow control characters for text input This now allows to insert e.g. zero-width joiner and zero-width non-joiner characters, which are needed for arabic/persian input M +2 -3 tools/selection/text/kpToolText_KeyboardEvents_HandleTypingKeys.cpp https://invent.kde.org/graphics/kolourpaint/commit/297feb5453c2ea7d3b27e9e5717211841fe20ac8
*** Bug 457978 has been marked as a duplicate of this bug. ***