8187364: Unable to enter zero width non-joiner (ZWNJ) symbol in Swing text component
Reviewed-by: serb, dmarkov
--- a/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java Mon Nov 12 12:39:03 2018 +0530
+++ b/src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java Mon Nov 12 22:28:08 2018 +0000
@@ -878,11 +878,10 @@
isPrintableMask = ((SunToolkit)tk).isPrintableCharacterModifiersMask(mod);
}
- if (isPrintableMask) {
- char c = content.charAt(0);
- if ((c >= 0x20) && (c != 0x7F)) {
- target.replaceSelection(content);
- }
+ char c = content.charAt(0);
+ if ((isPrintableMask && (c >= 0x20) && (c != 0x7F)) ||
+ (!isPrintableMask && (c >= 0x200C) && (c <= 0x200D))) {
+ target.replaceSelection(content);
}
}
}