<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Thanks Vyom. You could have proposed the patch yourself only...</p>
<p>Anyways, I have tested with Font2DTest with all unicodes for
default Latin and it seems ok. Will you be able to test in other
CJK locales (as I am not sure of the unicodes being displayed
correctly) just to ensure they are not adversely affected?</p>
Regards<br>
Prasanta<br>
<div class="moz-cite-prefix">On 14-May-20 9:01 PM, Vyom Tiwari
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAKysZ8xWyjoPFmWxWv43eoA+8GJ9mM11g7VV_xKBMPh9x=9U0g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi prasanta,</div>
<div><br>
</div>
<div>Code changes look OK to me, although I am not a expert in
this area, but the same patch resolves the issue at our end.</div>
<div>Thanks,</div>
<div>Vyom<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, May 14, 2020 at 4:20
PM Prasanta Sadhukhan <<a
href="mailto:prasanta.sadhukhan@oracle.com"
moz-do-not-send="true">prasanta.sadhukhan@oracle.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi All,</p>
<p>Please review a fix for an issue seen whereby
RTFEditorKit used to read Japanese characters reads some
garbage characters.</p>
<p>The default character set used for the RTF document is
set to "ansi" in our RTFReader.java. <br>
And share/classes/javax/swing/text/rtf/charsets/ansi.txt
code table has undefined values , i.e., 91-98 and A0 are
"0". According to javax/swing/text/rtf/RTFParser.java, If
the ch is 0, handleText() is not called</p>
<p>As per <a
href="http://www.biblioscape.com/rtf15_spec.htm#Heading8"
target="_blank" moz-do-not-send="true">http://www.biblioscape.com/rtf15_spec.htm#Heading8</a>,</p>
<p><i>RTF file includes the following Character set in its
header : </i><i><br>
</i><i> <character set> </i><i><br>
</i><i> (\ansi | \mac | \pc | \pca)? \ansicpgN? </i><i><br>
</i><i> Where, </i><i><br>
</i><i> \ansicpgN This keyword represents the default ANSI
code page used to perform the <b>Unicode to ANSI
conversion</b> when writing RTF text. N represents the
code page in decimal. This is typically set to the
default ANSI code page of the run-time environment (for
example, \ansicpg1252 for U.S. Windows). The reader can
use the same ANSI code page to convert ANSI text back to
Unicode. This keyword should be emitted in the RTF
header section right after the \ansi, \mac, \pc or \pca
keyword. </i><br>
</p>
<p>Possible values include those in the following table.We
can make use of ansicpgN (can switch ANSI text to
Unicode), define it to refer to the latin1TranslationTable
[RTFParser inherits it from AbstractFilter] which does not
include undefined areas instead of ansi's translationTable
which has undefined areas as seen above. <br>
</p>
<p>Bug: <a
href="https://bugs.openjdk.java.net/browse/JDK-8244324"
target="_blank" moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8244324</a></p>
<p>webrev: <a
href="http://cr.openjdk.java.net/~psadhukhan/8244324/webrev.0/"
target="_blank" moz-do-not-send="true">http://cr.openjdk.java.net/~psadhukhan/8244324/webrev.0/</a></p>
<p>Note: I am not able to create a testcase for this as it
involves reading from rtf file which probably is
copyrighted and inserting Japanese characters as a string
(instead of rtf file) was not working.<br>
</p>
</div>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">Thanks,<br>
Vyom</div>
</blockquote>
</body>
</html>