United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4498298 : Writing a manifest with doublebyte characters to a stream silently corrupts it

Details
Type:
Bug
Submit Date:
2001-08-30
Status:
Resolved
Updated Date:
2002-11-17
Project Name:
JDK
Resolved Date:
2002-11-17
Component:
core-libs
OS:
windows_nt
Sub-Component:
java.util
CPU:
other
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.3.1
Fixed Versions:
1.4.2 (mantis)

Related Reports

Sub Tasks

Description
Java users in e.g. Japan can create classes with doublebyte names, and naturally expect to be able to use the class names as section names, values of manifest entries, etc. But Attributes.write silently corrupts the doublebyte characters by writing only the low bytes.  There's a comment to the effect that UTF8 values should be handled.  It's correct.

This situation is also mentioned in Bug 4260272.

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis
mantis-b08


                                     
2004-06-14
WORK AROUND

None possible for a development tool.  While it would be possible to replace the java.util.jar classes for writing a manifest, reading a manifest from a stream has the same problem (it reads individual bytes, not UTF8 characters) so producing a UTF8 manifest would still result in errors when the manifest is read at runtime.
                                     
2004-06-11
SUGGESTED FIX

Write (and read back) text values as UTF8 rather than as bytes.
                                     
2004-06-11
PUBLIC COMMENTS

To allow all valid Java class names to be mentioned in a jar manifest, the manifest must be treated as UTF8.
                                     
2004-06-10
EVALUATION

target mantis, use utf8 encoding for "value" in manifest
###@###.### 2002-11-08
                                     
2002-11-08



Hardware and Software, Engineered to Work Together