Affects PMD Version: PMD 6.24.0
Description:
When running on a file with a different encoding than the system default, PMD can produce invalid XML.
Steps to reproduce:
Please provide detailed steps for how we can reproduce the bug.
pmd -d C:/tmp/MyClass.java -rulesets category/java/errorprone.xml/AvoidDuplicateLiterals -format xml -language java > out.xml
/tmp/out.xml:8: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0xE9 0xE9 0xE9 The String literal "��������" appears 5 times in this file; the first ^
In fact, in my case, these characters are in the Windows-1255 encoding. I think PMD uses this encoding because it uses the system property file.encoding
. One workaround is to use the same encoding as the file (UTF-8 by default).
Running PMD through: [CLI]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4