Bug #9642
Pasting UTF-8 character produces wrong result in text field
0%
History
#1 Updated by Șerban Bursuc over 1 year ago
- File 9193_utf8_char_oe.png added
- File 9193_utf8_char_fwd.png added
Original discussion from #9193.
Take the following testcase:
define variable edt as character
view-as editor max-chars 120
size 73 by 2.14 no-undo.
define frame fr.
enable edt with frame fr.
wait-for close of current-window.
And set the codepage in directory.xml to CP1252 or other with less mappable characters than UTF-8:
<node class="container" name="i18n">
<node class="string" name="cpinternal">
<node-attribute name="value" value="1252"/>
</node>
</node>
Start the application in Web UI (Swing untested) and then copy paste an UTF-8 character like ‰. The expected result:

The actual result:

For a FILL-IN widget the paste does work, but the character should not be displayed as is, as the codepage does not map it and should produce a different character.
From #9193 preliminary investigation:
- First issue
The clipboard buffer is not being inserted into the text field until another character is inserted or a repaint is done.
- Second issue
The character is considered printable/acceptable when the copy paste works.
- Third issue
If the character is not mappable then the result should be a black line like in OE.
Useful resource for investigation:
https://community.progress.com/s/article/000042967
#2 Updated by Sergey Ivanovskiy over 1 year ago
Greg, should we show black boxes for unmappable unicode character when this character is pasted into the editor? Should GUI editor be extended to able to insert unicode symbols?
#3 Updated by Greg Shah over 1 year ago
Greg, should we show black boxes for unmappable unicode character when this character is pasted into the editor?
Yes, it should display the same way as in OE.
Should GUI editor be extended to able to insert unicode symbols?
Yes. Wherever we can safely take unicode input and display it, we should. The only exception is if there is some specific OE behavior that needs to be duplicated.
#4 Updated by Sergey Ivanovskiy over 1 year ago
Greg, this issue should be split on two issues. The extracted issue is the GUI editor incorrectly paste content that is unrelated to UTF-8 character and the logic to support unicode characters in Gui editors.
#5 Updated by Greg Shah over 1 year ago
Go ahead, I'm OK to split this into 2 issues.