JDK-4498298 : Writing a manifest with doublebyte characters to a stream silently corrupts it
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: other
  • Submitted: 2001-08-30
  • Updated: 2002-11-17
  • Resolved: 2002-11-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
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
14-06-2004

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.
11-06-2004

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

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

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