want to support utf-8 in xml output report
------------------------------------------

                 Key: MOJO-916
                 URL: http://jira.codehaus.org/browse/MOJO-916
             Project: Mojo
          Issue Type: Wish
          Components: findbugs
         Environment: Windows XP, findbugs-maven-plugin (1.2-SNAPSHOT, revision 
5140), dashboard-maven-plugin (1.0-SNAPSHOT, revision 4878)
            Reporter: Kenji Watatani


Hi, I use findbugs-maven-plugin and dashboard-maven-plugin in Japanease 
environment.

Current XML report's character encoding is ISO-8859-1. But, this setting is not 
supported 2-byte characters.
(src/main/groovy/org/codehaus/mojo/findbugs/FindbugsXdocSink.groovy:118)

Therefore, dashboard-maven-plugin crush when read findbugs.xml.

Would you apply below patch ?
This patch changes character encoding from ISO-8859-1 to UTF-8 and encoding 
value in xml declaration from "ISO-8859-1" to "utf-8".


================= patch =====================

Index: .
===================================================================
--- .   (revision 5178)
+++ .   (working copy)
@@ -24,6 +24,7 @@
 import org.apache.maven.doxia.module.HtmlTools;
 import org.apache.maven.doxia.sink.SinkAdapter;
 import org.apache.maven.doxia.util.LineBreaker;
+import java.io.OutputStreamWriter;
 
 /**
  * A doxia Sink which produces an FindBugs model.
@@ -39,7 +40,7 @@
 
     FindbugsXdocSink( Writer out )
     {
-        this.out = new LineBreaker( out );
+               this.out = new LineBreaker( out );
     }
 
     void analysisErrorTag( String className )
@@ -115,7 +116,7 @@
 
     void head()
     {
-        this.markup( "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + EOL );
+        this.markup( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + EOL );
     }
 
     void missingClassTag( String className )
@@ -127,7 +128,8 @@
 
     protected void markup( String text )
     {
-        this.out.write( text, true );
+       // output character encoding transform to utf-8
+        this.out.write( new String( text.getBytes("iso-8859-1") , "UTF-8" ) , 
true );
     }
 
     void ProjectTag()


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to