changeset 60052:24334c31ec68

8244324: RTFEditorKit does not display some of Japanese characters correctly Reviewed-by: serb, psadhukhan Contributed-by: vyommani@gmail.com
author psadhukhan
date Thu, 02 Jul 2020 09:31:42 +0530
parents 8e75be7a499a
children 6be09b0e84e6
files src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java	Thu Jul 02 09:29:42 2020 +0530
+++ b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java	Thu Jul 02 09:31:42 2020 +0530
@@ -133,6 +133,7 @@
   static boolean useNeXTForAnsi = false;
   static {
       characterSets = new Hashtable<String, char[]>();
+      defineCharacterSet("ansicpg", latin1TranslationTable);
   }
 
 /* TODO: per-font font encodings ( \fcharset control word ) ? */
@@ -487,6 +488,11 @@
         keyword.equals("private"))
         ignoreGroupIfUnknownKeywordSave = true;
 
+     if (keyword.contains("ansicpg")) {
+         setCharacterSet("ansicpg");
+         return true;
+     }
+
     if (rtfDestination != null) {
         if(rtfDestination.handleKeyword(keyword, parameter))
             return true;