Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2837

PDFBox creates files with EBCDIC code on z/OS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.8.10, 2.0.0
    • Fix Version/s: 1.8.10, 2.0.0
    • Component/s: Writing
    • Labels:
      None
    • Environment:
      OS: Unix Service running on Z/OS.
      JRE: JRE 1.6.0 IBM J9 2.4 z/OS s390-31

      Description

      A PDF file created on z/OS (an IBM mainframe os) has this

      xref
      ð ù
      0000000000 65535 f
      

      the two chars are EBCDIC code for 0 9. The cause is this code that outputs in the system default encoding:

          private void writeXrefRange(long x, long y) throws IOException
          {
              getStandardOutput().write(String.valueOf(x).getBytes());
              getStandardOutput().write(SPACE);
              getStandardOutput().write(String.valueOf(y).getBytes());
              getStandardOutput().writeEOL();
          } 
      

      getBytes should use the specific charset, e.g. getBytes(Charsets.ISO_8859_1).

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: