<AWT Dev> [12] RFR JDK-8191178:[macos] Problem with input of yen symbol
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Mon Sep 17 09:02:42 UTC 2018
Hi All,
Please review a fix for an issue where
when "yen" symbol is entered from a keyboard using Romaji keyboard
layout using "backslash" character, it was showing a "backslash" character
rather than "yen" symbol.
This is a regression of JDK-8068283
<https://bugs.openjdk.java.net/browse/JDK-8068283> where the check to
control JNI invocation of
"sun.lwawt.macosx.CInputMethod.insertText(String)" is changed from
"if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1))
to
if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2))
Now, in this case for "yen" symbol, the utf16Length is 2 so
InputMethodEvent is not generated, rather a KeyEvent is generated for
"\" character.
This check was again modified for JDK-8132503
<https://bugs.openjdk.java.net/browse/JDK-8132503> where the check for
unichar belongs to certain unicode block is introduced
/(utf8Length > 1) && [self
isCodePointInUnicodeBlockNeedingIMEvent:[useString characterAtIndex:0]]/
Now, there although utf8Length is 2 the check for codepoint is complex
or not does not take into account "unicode" currency symbols.
It only takes into account CJK symbols and punctuations and "Halfwidth
and Fullwidth Forms' Unicode block.
Proposed fix also add "currency" symbol unicode
[[https://www.fileformat.info/info/unicode/category/Sc/list.htm]
in the mix so that we can have InputmethodEvent generated for currency
symbols.
Bug: https://bugs.openjdk.java.net/browse/JDK-8191178
webrev: http://cr.openjdk.java.net/~psadhukhan/8191178/webrev.0/
Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20180917/7862f54f/attachment.html>
More information about the awt-dev
mailing list