‎2010 Mar 22 4:26 PM
Hi guru,
I used the class CL_GUI_TEXTEDIT to input text, but I cannot type unicode.
I checked the sample program SAPTEXTEDIT_TEST_EVENTS. The upper text edit, I cannot type unicode, but the lower text edit, I can.
Could anyone explain me why this happens?
Thanks.
‎2010 Mar 22 11:06 PM
What do you mean by Unicode character (as all characters are part of unicode). Could you give one example, and tell us what you get when you type this "unicode character". I don't know what happens but the 2 controls are exactly the same, so that's really weird.
‎2010 Mar 23 10:33 AM
Thanks for your reply.
I knew the reason. If you use the language that has the accents (for ex: Vietnamese), when you type in textedit, it does not display correctly.
The reason stays in the parameter WORDWRAP_MODE of CONSTRUCTOR method (should use 0 or 1, but 2).
So I close this thread.
Edited by: Kebab Monsieur on Mar 23, 2010 11:33 AM
‎2010 Mar 23 2:02 PM
I couldn't find any information in SAP marketplace about a problem with WORDWRAP_MODE.
Check the SAP notes (for example Note 766995 - CNDP/text edit: Characters are truncated on Unicode systems)
and make sure to use the latest SAPGUI.
‎2010 Mar 24 3:01 AM
@Venkat:
Thanks. I read this thread before.
@Sandra:
You can test with the program SAPTEXTEDIT_TEST_EVENTS for the following phrase "nhà cung cấp" (it means the supplier).
You will see the upper textedit displaying the text incorrectly, but the lower textedit.
Thanks all for your replies.
‎2010 Mar 24 5:12 AM
Interesting. I've tested with report SAPTEXTEDIT_TEST_EVENTS as you suggested on an ECC 6.0 box and the text also got displayed incorrectly. To be more specific, in the upper text edit control the ấ character gets displayed as a rectangular box, whereas the lower text control shows all characters correctly. Interestingly enough, when I export the contents of the upper text control to a local file and use Notepad to look at it, all characters are displayed correctly.
Tried to search OSS, but couldn't really find anything useful. I came across OSS note [766995|https://service.sap.com/sap/support/notes/766995], which Sandra mentioned, but this is not applicable (only up to basis 6.40). The program coding didn't really show much differences.
Are you saying that you can fix it in your own coding if you change the wordwrap parameter as you described?
Also, I tried to pasted lots of Chinese text from the forums here into the text control. None of the characters got messed up, only the ấ (Unicode code point U+1EA5) showed this behavior (might be others, but I didn't ran into any other issues with my test samples).
I appreciate if you could keep us updated on this weird behavior.
Cheers, harald
‎2010 Mar 24 10:52 AM
Thx for the info. I also have the same weird behavior (as detailed by Harald) with SAPGUI 7.1 SP 13, and SAP Basis 7.0 SP 13, my computer has French_France locale.
gotcha! when you use wordwrap_at_fixed_position mode, the textedit control displays the characters in a fixed font by default (Courier New in my case, that does not contain Vietnamese characters). When you use one of the 2 other modes, it displays in a proportional font (Arial in my case, that does contain Vietnamese characters).
You may make it work if you change the SAPGUI option (alt-F12) Character Set to Vietnamese. I guess SAP automatically chooses a font that contains the Vietnamese characters (Tahoma in my case, I don't know why it doesn't choose Arial as it also contains Vietnamese characters, as it did in the case above).
sandra
Edited by: Sandra Rossi on Mar 24, 2010 2:22 PM
‎2010 Mar 25 5:08 AM
Hey Sandra,
Good observation (I completely missed the difference in the fonts) and good information on switching the character set. It's actually nice to see with program SAPTEXTEDIT_TEST_2, where one can toggle between fixed font and proportional font.
I must admit the handling of the special characters is still a bit of a mystery to me. E.g. I have the Unicode option enabled and in a simple test report where I used a WRITE statement to print special characters (chinese, etc.) SAP automatically switched to a font that could display the characters. Guess the problem is that the text edit control has to settle on one font and all non-proportional fonts are basically lacking the more "exotic" characters. Should probably do some reading on how SAPgui handles all this...
Thanks for the update.
Cheers, harald
‎2010 Mar 23 2:06 PM