[
https://issues.apache.org/jira/browse/RAT-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matthias Bläsing updated RAT-242:
---------------------------------
Attachment: rat-242.patch
I'm sorry, but the first patch was not correct. I should have known better than
to propose this without a unittest. The attached files contains a follow-up
patch (based on svn-trunk). This patch:
* adds unittests to ant and maven modules to verify the behavior
* modifies the ant report task to use the platform encoding for the
LogOutputStream (that construct is basicly a string -> bytearray -> string
conversion and it uses the default encoding for the second part, so the first
part also need to use that)
* modifies the ant report task to use the UTF-8 encoding for file output
It is important, that the "iso-8859-1.html" files are encoded as
ISO-8859-1/windows-1252 (if opened with that encoding the umlauts have to be
visible). I applied the patch with "svn patch" and it produced the correct
files.
The unittest use reflection to reset the file.encoding at runtime. This might
be a problem for different java implementations (it is expected that Charset
has a defaultCharset field member) and for jdk9 the java.base module needs to
be opened.
> Encoding of XML report
> ----------------------
>
> Key: RAT-242
> URL: https://issues.apache.org/jira/browse/RAT-242
> Project: Apache Rat
> Issue Type: Bug
> Components: reports
> Affects Versions: 0.12
> Environment: ubuntu
> Reporter: Eric Barboni
> Attachments: rat-242.patch
>
>
> Hi, we encounter an issue with encoding of a xml rat report.
> We try to parse an xml rat report generated on an iso-8859-1 file system. The
> xml has no encoding element in the prolog. If you open it with fileinpustream
> it may fail.
> last comment in this pull request
> (https://github.com/apache/incubator-netbeans/pull/70) by Matthias Bläsing
> suggest forcing to UTF-8.
> encoding may also be an option in the report task
> Regards
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)