[
https://issues.apache.org/jira/browse/PDFBOX-5020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Emanuel Cozariz updated PDFBOX-5020:
------------------------------------
Component/s: FontBox
> Surrogate characters are decoded wrongly in makeJustificationArray
> ------------------------------------------------------------------
>
> Key: PDFBOX-5020
> URL: https://issues.apache.org/jira/browse/PDFBOX-5020
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.21
> Reporter: Emanuel Cozariz
> Priority: Major
>
> Given the following string 𧙗, this will be encoded as '\uD85D\uDE57'
>
> The above string will be accepted by the font CODE2002.ttf
>
> {code:java}
> PDFont font = PDType0Font.load(doc, new File("CODE2002.ttf"));PDFont font =
> PDType0Font.load(doc, new File("CODE2002.ttf")); cs.showText("\uD85D\uDE57");
> {code}
> But it is not correct decoded.
> Method makeJustificationArray of PdfBoxFastOutputDevice
> uses Character.toString(c) to add to the data array
> uD85D => Character.toString(c) will decode as �
> uDE57 => Character.toString(c) will decode as �
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]