You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Oliver Schmitz-Hennemann (JIRA)" <ji...@codehaus.org> on 2011/04/20 11:40:22 UTC

[jira] Created: (MCHANGES-236) output encoding not used for writing changes-report.html file

output encoding not used for writing changes-report.html file
-------------------------------------------------------------

                 Key: MCHANGES-236
                 URL: http://jira.codehaus.org/browse/MCHANGES-236
             Project: Maven 2.x Changes Plugin
          Issue Type: Bug
          Components: changes.xml
    Affects Versions: 2.4
         Environment: found on mac OS
            Reporter: Oliver Schmitz-Hennemann


Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 

Details: 
org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
The content type header of the html file claims utf-8, thus some characters are invalid. 

This may also be related to MCHANGES-168, where there is a problem with greek characters.

>From the javadoc of FileWriter : 
 * Convenience class for writing character files.  The constructors of this
 * class assume that the default character encoding and the default byte-buffer
 * size are acceptable.  To specify these values yourself, construct an
 * OutputStreamWriter on a FileOutputStream.

To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 

Supposed Fix: use the specified output Encoding also for writing to the file 

change line 188 : from 
 
            Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );

To 

      File file = new File(outputDirectory, getOutputName() + ".html");
      Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());

That worked fine on mac and linux.

-- 
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

        

[jira] Updated: (MCHANGES-236) Configured outputEncoding not used for writing changes-report.html file

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MCHANGES-236:
-------------------------------------

    Summary: Configured outputEncoding not used for writing changes-report.html file  (was: output encoding not used for writing changes-report.html file)

> Configured outputEncoding not used for writing changes-report.html file
> -----------------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt, systemProperties.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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

        

[jira] Commented: (MCHANGES-236) output encoding not used for writing changes-report.html file

Posted by "Oliver Schmitz-Hennemann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=264169#action_264169 ] 

Oliver Schmitz-Hennemann commented on MCHANGES-236:
---------------------------------------------------

I can reproduce the bug on my mac with german mac-os
Most interestingly the system claims to use utf-8
The response to locale command is: 

LANG="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_CTYPE="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_ALL=

However the java environment seems to use mac-os roman as default charset.
See systemProperties attachment


> output encoding not used for writing changes-report.html file
> -------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt, systemProperties.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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

        

[jira] Commented: (MCHANGES-236) Configured outputEncoding not used for writing changes-report.html file

Posted by "Oliver Schmitz-Hennemann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=264346#action_264346 ] 

Oliver Schmitz-Hennemann commented on MCHANGES-236:
---------------------------------------------------

Tested snapshot 2.5, problem is fixed, thanks!

> Configured outputEncoding not used for writing changes-report.html file
> -----------------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>            Assignee: Dennis Lundberg
>             Fix For: 2.5
>
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt, systemProperties.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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

        

[jira] Closed: (MCHANGES-236) Configured outputEncoding not used for writing changes-report.html file

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg closed MCHANGES-236.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
         Assignee: Dennis Lundberg

Patch applied with modifications in [r1095497|http://svn.apache.org/viewvc?view=revision&revision=1095497].
Thanks!

New 2.5-SNAPSHOT deployed. Please test it.

> Configured outputEncoding not used for writing changes-report.html file
> -----------------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>            Assignee: Dennis Lundberg
>             Fix For: 2.5
>
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt, systemProperties.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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

        

[jira] Updated: (MCHANGES-236) output encoding not used for writing changes-report.html file

Posted by "Oliver Schmitz-Hennemann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Schmitz-Hennemann updated MCHANGES-236:
----------------------------------------------

    Attachment: changes-encoding-patch.txt
                Bildschirmfoto 2011-04-20 um 11.16.01.png

Screenshot of wrong output in safari on german mac and patch with supposed change.

> output encoding not used for writing changes-report.html file
> -------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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

        

[jira] Updated: (MCHANGES-236) output encoding not used for writing changes-report.html file

Posted by "Oliver Schmitz-Hennemann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCHANGES-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Schmitz-Hennemann updated MCHANGES-236:
----------------------------------------------

    Attachment: systemProperties.txt

slighlty cleaned up result of a System.getProperties().toString() on my machine, with some encoding information.

> output encoding not used for writing changes-report.html file
> -------------------------------------------------------------
>
>                 Key: MCHANGES-236
>                 URL: http://jira.codehaus.org/browse/MCHANGES-236
>             Project: Maven 2.x Changes Plugin
>          Issue Type: Bug
>          Components: changes.xml
>    Affects Versions: 2.4
>         Environment: found on mac OS
>            Reporter: Oliver Schmitz-Hennemann
>         Attachments: Bildschirmfoto 2011-04-20 um 11.16.01.png, changes-encoding-patch.txt, systemProperties.txt
>
>
> Writing Java Strings to changes-report.html file ignores outputEncoding and uses system default encoding instead. 
> Details: 
> org/apache/maven/plugin/changes/AbstractChangesReport.java uses a FileWriter, which uses the default encoding of the environment instead of the configured output encoding for writing strings to the file. 
> This creates some problems with german umlaut characters on my mac for example, because the environment default is not utf-8 but mac-OS roman.
> The content type header of the html file claims utf-8, thus some characters are invalid. 
> This may also be related to MCHANGES-168, where there is a problem with greek characters.
> From the javadoc of FileWriter : 
>  * Convenience class for writing character files.  The constructors of this
>  * class assume that the default character encoding and the default byte-buffer
>  * size are acceptable.  To specify these values yourself, construct an
>  * OutputStreamWriter on a FileOutputStream.
> To Reproduce, run the changes plugin with the changes.xml file under src/test/unit with a german locale on a german mac with current java-developer package. Opening this file in safari leads to the attached result. 
> Supposed Fix: use the specified output Encoding also for writing to the file 
> change line 188 : from 
>  
>             Writer writer = new FileWriter( new File( outputDirectory, getOutputName() + ".html" ) );
> To 
>       File file = new File(outputDirectory, getOutputName() + ".html");
>       Writer writer = new OutputStreamWriter(new FileOutputStream(file), getOutputEncoding());
> That worked fine on mac and linux.

-- 
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