[ 
https://issues.apache.org/jira/browse/PDFBOX-3184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15090661#comment-15090661
 ] 

Andreas Lehmkühler edited comment on PDFBOX-3184 at 1/9/16 3:36 PM:
--------------------------------------------------------------------

I've doublechecked the given use case and came to the conclusion that the range 
check is wrong.

We compared apples and oranges. PDFont#encode expects unicode code points and 
the range check valid for encoding specific codes (in this case 
WinAnsiEncoding). This works for a lot of character but not for all
{quote} 
"bullet" maps to \u+2022 (unicode) and \u+0095 (WinAnsiEncoding)
{quote} 
Furthermore the first test isn't necessary at all as a second one follows. The 
codepoint is tranfered to a name using GlyphList and if the name isn't valid 
for the given encoding an IllegalArgumentException is thrown.


was (Author: lehmi):
I've doublechecked the given use case and came to the conclusion that the range 
check is wrong.

We compared apples and oranges. PDFont#encode expects unicode code points and 
the range check valid for encoding specific codes (in this case 
WinAnsiEncoding). This works for a lot of character but not for all
{quote} 
"bullet" maps to \u+2022 (unicode) and \u+0095 (WinAnsiEncoding)
{quote} 
Furthermore the first test isn't necessary at all as a second one follows. The 
codepoint is tranfered to a name using GlyphList and if the name isn't valid 
for the given encoding an IllegalArgumentExcpetion is thrown.

> Throwing in PDType1Font.encode for chars above 255 is wrong.
> ------------------------------------------------------------
>
>                 Key: PDFBOX-3184
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3184
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.0
>            Reporter: Maaartinus
>            Assignee: Andreas Lehmkühler
>             Fix For: 2.0.0
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Chars like `'\u2019'` can be handled by the code following the test, so 
> throwing in `PDType1Font.encode` whenever `unicode > 0xff` is wrong. See
> [http://stackoverflow.com/a/34598915/581205]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to