ICEpdf
  1. ICEpdf
  2. PDF-260

Octal Encoded Outline text is encorrectly encoded.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      any

      Description

      The community member brought to my attention an encoding issue with some Greek characters in the form attached document.

        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Patrick Corless added a comment -

        If you take a look at the OutlineItem.java class the method getTitle() does a bunch a work to property encode the title.

        From my initial analysis the the getBytes() call is not applying the correct encoding and the resulting byte stream isn't correct.

        I've have to do a bunch of regression testing but I think the getBytes() call should be removed and the following for loop should be replaced with:

        for (int i = 2; i < hexTmp.length(); i += 2) {
        try

        { int b1 = ((int) hexTmp.charAt(i)) & 0xFF; int b2 = ((int) hexTmp.charAt(i + 1)) & 0xFF; sb1.append((char) (b1 * 256 + b2)); }

        catch (Exception ex)

        { // intentionally left blank. }

        }

        Show
        Patrick Corless added a comment - If you take a look at the OutlineItem.java class the method getTitle() does a bunch a work to property encode the title. From my initial analysis the the getBytes() call is not applying the correct encoding and the resulting byte stream isn't correct. I've have to do a bunch of regression testing but I think the getBytes() call should be removed and the following for loop should be replaced with: for (int i = 2; i < hexTmp.length(); i += 2) { try { int b1 = ((int) hexTmp.charAt(i)) & 0xFF; int b2 = ((int) hexTmp.charAt(i + 1)) & 0xFF; sb1.append((char) (b1 * 256 + b2)); } catch (Exception ex) { // intentionally left blank. } }
        Patrick Corless made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 4.2 [ 10243 ]
        Patrick Corless created issue -
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #23980 Thu Feb 17 11:29:31 MST 2011 patrick.corless PDF-260 updated how octal outline text is decoded, rather that applying an arbitrary encoding with string.getBtytes we apply our own custom encoding.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/src/org/icepdf/core/pobjects/OutlineItem.java

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: