RFR: 6928542: Chinese characters in RTF are not decoded

Phil Race prr at openjdk.org
Thu Aug 17 21:07:34 UTC 2023


On Thu, 20 Apr 2023 05:47:35 GMT, Ichiroh Takiguchi <itakiguchi at openjdk.org> wrote:

> "character set of font" (font charset) table was created by "Rich Text Format Specification 1.9.1"
> https://interoperability.blob.core.windows.net/files/Archive_References/[MSFT-RTF].pdf
> It refers windgi.h
> https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-textmetrica
> 
> Test files and testcase are in bugid [JDK-6928542](https://bugs.openjdk.org/browse/JDK-6928542)
> 
> Additional change:
> Special character `\line` should `\n`
> 
> **Note:** Following GitHub actions were failed
> linux-x86 / test (jdk/tier1 part 1) was failed, it seems it was already reported
>> [JDK-8305875](https://bugs.openjdk.org/browse/JDK-8305875) Test TraceVirtualThreadLocals should be run with continuations only
> 
> windows-aarch64 / build (debug) was failed, but I have no idea...

src/java.desktop/share/classes/javax/swing/text/rtf/RTFParser.java line 376:

> 374:     private char[] ca = new char[1];
> 375:     private CharBuffer decoderCB = CharBuffer.wrap(ca);
> 376: 

So I know in theory what needs to be done here, and the test looks thorough,
but basically you've dumped code on us with zero explanation of the fix,
and I've spent quite a while figuring out some of it but I think you owe it to reviewers to do a much better job
of explaining the logic and flow. 
The function below needs particular explanation. 
One thing (not the only thing !) I want you to describe is what you are using \uFFFD for in various places in this change.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13553#discussion_r1297750712


More information about the client-libs-dev mailing list