Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6457717

Manifest file can not include UTF-8 string correctly.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
      jar
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      mustang
      build 1.6.0-rc-b94

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP2

      A DESCRIPTION OF THE PROBLEM :
      In the manifest specification,
      - Each line in manifest file must be UTF-8 encoding.
      - Each line in manifest file must be under 72 bytes.

      But it seems that java.util.jar.Manifest class could not treat lines as UTF-8.

      I found this problem while I use jarsigner.
      I tried to sign a jar file including UTF-8 filenames.(non-ascii)

      Manifest class seems to have 2 problems.

      - It cut each line by String.length not by byte length.
         >> should cut by bytes length.
      - It uses DataOutputStream.writeBytes(String) which is not appreciate treat UTF-8 correctly.(high-bits dropped)
         >> should use String.getBytes() method

      I checked this problem on
      - JDK 1.5.0_07
      - JDK 1.6.0 b94


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Don't use UTF-8 character in Manifest file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: