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

        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. } }

          People

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

            Dates

            • Created:
              Updated:
              Resolved: