Closed abLoftware closed 4 years ago
I think I've fixed the issue - new version available from Maven/GitHub now!
Looks good! Thanks for the quick turnaround!!
Andre
From: Jon Iles notifications@github.com Sent: Tuesday, March 31, 2020 12:31 PM To: joniles/rtfparserkit rtfparserkit@noreply.github.com Cc: Andre Boutin ABoutin@loftware.com; Author author@noreply.github.com Subject: Re: [joniles/rtfparserkit] Incorrect encoding for current font (#23)
I think I've fixed the issue - new version available from Maven/GitHub now!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/joniles/rtfparserkit/issues/23#issuecomment-606735856, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIEWFCKOLGPHEFYSUKLNRSTRKILCPANCNFSM4LXVL6UQ.
Believe this issue is related to https://github.com/joniles/rtfparserkit/issues/22
the encoding being used is being defaulted to font 0 rather then the currently set font (via \fN) this appears to be an issue with the value of ParserState.currentFontExplicitlySet being "false" in method StandardRtfParser.currentEncoding(), where if the value is false it sets the current encoding to whatever it is set for font 0
I've attached a unit test file and an rtf file,
the unit test contains 2 tests, 1 that shows success if there is only 1 font, and 1 that fails if there are 2 fonts, and the second font is being used I've added ".txt" to the files since some extensions are problematic for attachments
testJapaneseJisEncoding_2Fonts.rtf.txt
TestBug2.java.txt