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 184135 - Encoding in manifest files is always utf-8 (or utf-16?)
Summary: Encoding in manifest files is always utf-8 (or utf-16?)
Status: RESOLVED WORKSFORME
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 11:52 UTC by arittner
Modified: 2010-10-06 19:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arittner 2010-04-14 11:52:31 UTC
On building a nbm project the description from my pom-file is encoded as UTF-8.

Example in my pom.xml:

<description>Die Grundkonfiguration stellt eine unab&auml;nderbare Basiseinstellung der Anwendung ein. Dieses Modul steuert generelle Userinterface-Einstellungen.</description>

Result in the manifest:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: Rittner
Build-Jdk: 1.6.0_14-ea
OpenIDE-Module-Localizing-Bundle: de/sepix/sxbase/Bundle.properties
OpenIDE-Module-Layer: de/sepix/sxbase/layer.xml
OpenIDE-Module-Specification-Version: 4.2
OpenIDE-Module-Implementation-Version: 4.2-20100414
OpenIDE-Module-Build-Version: 201004140134
OpenIDE-Module: de.sepix.branding
OpenIDE-Module-Public-Packages: -
OpenIDE-Module-Requires: org.openide.modules.ModuleFormat1
OpenIDE-Module-Display-Category: de.sepix
OpenIDE-Module-Name: S3 V4.2 - Grundkonfiguration
OpenIDE-Module-Short-Description: Die Grundkonfiguration stellt eine u
 nabänderbare Basiseinstellung der Anwendung ein. Dieses Modul steuer
 t generelle Userinterface-Einstellungen.
OpenIDE-Module-Long-Description: Die Grundkonfiguration stellt eine un
 abänderbare Basiseinstellung der Anwendung ein. Dieses Modul steuert
  generelle Userinterface-Einstellungen.
OpenIDE-Module-Module-Dependencies:  org.openide.util > 8.6



My configuration:

NetBeans: Executing 'C:\Entw\apache-maven-2.2.1\bin\mvn.bat -Dnetbeans.execution=true clean install'
NetBeans:      JAVA_HOME=C:\Entw\jdk\1.6.0_14

Product Version: NetBeans IDE Dev (Build 201004120251)
Java: 1.6.0_14-ea; Java HotSpot(TM) Client VM 14.0-b11
System: Windows XP version 5.1 running on x86; Cp1252; de_DE (nb)


br, josh.
Comment 1 Jesse Glick 2010-04-14 16:13:05 UTC
The manifest specification defines the encoding to be UTF-8.
Comment 2 arittner 2010-04-14 19:52:59 UTC
Hi Jesse,

so we have a bug in the plugin manager? The displayed description shows garbled glyphs for the German umlaut a (ä).

thank you for the clarification, I'll file a new bug.

br, josh.
Comment 3 Jesse Glick 2010-04-14 20:30:43 UTC
(In reply to comment #2)
> so we have a bug in the plugin manager?

I don't know, depends on whether the manifest is in fact in UTF-8 or not. If yes, then the Plugin Manager is at fault; if no, then the nbm packaging plugin for Maven is at fault.

(I am assuming your POM declares the actual encoding it uses, whatever that may be.)
Comment 4 arittner 2010-04-14 21:32:46 UTC
I can't see any effect by different encoding settings. One is the xml-encoding (at top of the pom.xml, UTF-8) and one is the project encoding settings (for source code files, a maven specific parameter and in my project: ANSI). But the manifest text is always encoded as UTF-XX (IMHO UTF-16, unabänderbare -> 4 Bytes for ä).

Specification: 

http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Name-Value%20pairs%20and%20Sections

You are right, it should be UTF-8. And "unabänderbare" to UTF-8 is "unabänderbare" (here is an online en/decoder for utf-8: http://coderstoolbox.net/string/), not "unabänderbare".

And it's not a wrong character in the pom.xml, I use &auml; 

Is it ok to reopen the issue?

br, josh.
Comment 5 Jesse Glick 2010-10-06 19:01:33 UTC
Would need a complete sample project to test with. In my test, using maven-nbm-plugin 3.3, including &auml; in the POM renders it invalid:

XML validation started.
Checking file:/tmp/test184135/pom.xml...
The entity "auml" was referenced, but not declared. [11] 
XML validation finished.

When I use &#228; instead, the correct character with umlaut is displayed in MANIFEST.MF and Info.xml, and rendered correctly in Plugin Manager. This on Ubuntu.