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.
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.
- duplicates
-
JDK-6202130 java.util.jar.Attributes.writeMain() can't handle multi-byte chars
-
- Open
-