This issue has been created
There are 2 updates.
 
 
XWiki Commons / cid:jira-generated-image-avatar-4c9be776-169b-4715-869d-dda6e548d6b0 XCOMMONS-3833 Open

Enforce the file encoding rules with Checkstyle

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-fd6a1fa7-5e73-4738-b563-d3f4c5d051a2 Vincent Massol created this issue on 13/Oct/26 18:59
 
Summary: Enforce the file encoding rules with Checkstyle
Issue Type: cid:jira-generated-image-avatar-4c9be776-169b-4715-869d-dda6e548d6b0 Improvement
Assignee: Unassigned
Components: Development Issues only
Created: 13/Oct/26 18:59
Priority: cid:jira-generated-image-static-major-58ac9000-79e7-40bb-9347-e52efe89552b Major
Reporter: Vincent Massol
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.
 
 

2 updates

 
cid:jira-generated-image-avatar-fd6a1fa7-5e73-4738-b563-d3f4c5d051a2 Changes by Vincent Massol on 13/Oct/26 18:59
 
Fix Version: 18.9.0-rc-1
Assignee: Vincent Massol