This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238263

Summary: Missing manifestEncoding attribute from copylibs
Product: java Reporter: t_gergely
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED FIXED    
Severity: normal CC: t_gergely
Priority: P2    
Version: 8.1   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 262429, 262430    
Bug Blocks:    

Description t_gergely 2013-11-12 10:40:34 UTC
If UTF-8 is used in manifest.mf (eg. Application-Name) and the OS default encoding is different (it sure is in Windows), the manifest in the jar will be "double encoded".

As a workaround, I added manifestEncoding="${source.encoding}" attribute to the copylibs tag in build-impl.xml
Comment 1 t_gergely 2016-02-05 12:38:49 UTC
2+ years have passed. How can I help?
Comment 2 Tomas Zezula 2016-06-14 08:59:28 UTC
The problem is a bit more difficult as the manifest is processed on more places.
1st) It's copied to tmpfile
2nd) It's optionally extended by Main-Class, Profile, etc depending on presence of main class, JDK8 Profiles ...
3rd) It's inserted into the jar by copylibs or jar task.

The output encoding of written manifest in jar, copylibs and manifest task is always UTF-8. So the copy of manifest needs to convert manifest from source.encoding to UTF-8 and all following manifest, jar, copylibs task need manifestEncoding=UTF-8.
Comment 3 Tomas Zezula 2016-06-14 13:38:24 UTC
Fixed for Ant J2SEProject, WebStart and J2SE Embedded.
The same problem is probably in JavaFx project.
I will create a new issue and evaluate.
Comment 4 t_gergely 2016-06-14 14:24:16 UTC
(In reply to Tomas Zezula from comment #3)
> Fixed for Ant J2SEProject, WebStart and J2SE Embedded.
> The same problem is probably in JavaFx project.
> I will create a new issue and evaluate.

Thanks. What about javaee.project?
Comment 5 Tomas Zezula 2016-06-14 16:57:22 UTC
The J2SE Deploy completely ignores user manifest, I've created issue #262429.
The JavaFx project ignores user manifest as well, issue #262430.
The J2EE is basically a copy of J2SE but maintained by someone else, the patch should be easy to migrate. I will fill an issue for j2ee and add a link here.
Comment 6 Tomas Zezula 2016-06-14 17:17:43 UTC
The j2ee issue #262431.
Comment 7 Quality Engineering 2016-06-15 01:53:23 UTC
Integrated into 'main-silver', will be available in build *201606150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/472eec6c219c
User: Tomas Zezula <tzezula@netbeans.org>
Log: #238263:Missing manifestEncoding attribute from copylibs