Details
-
Improvement
-
Resolution: Fixed
-
Major
-
17.10.0
-
None
Description
Following the vote at https://forum.xwiki.org/t/move-java-sources-to-utf-8-and-update-the-file-encoding-rules/18925, Java sources are UTF-8 and may contain non-ASCII characters, and properties files are ISO-8859-1.
- Add a Checkstyle rule (in checkstyle.xml and checkstyle-test.xml) failing the build when a Java source contains an invisible or ambiguous character written raw instead of as a unicode escape: control characters, non-breaking spaces, soft hyphens, zero-width characters, bidirectional control characters and byte order marks. Such characters can't be seen in code reviews and can hide bugs or malicious code (CVE-2021-42574, "Trojan Source").
- Add a Checkstyle rule failing the build when a properties file is encoded in UTF-8 instead of ISO-8859-1, which would display garbled characters at runtime.
- Add an .editorconfig to commons, rendering and platform declaring these encodings, and fix the existing violations.
Attachments
Issue Links
- is related to
-
XWIKI-25284 The French CSRF confirmation page displays a garbled character
-
- Closed
-