Branch: refs/heads/master Home: https://github.com/jenkinsci/scriptler-plugin Commit: ab3d736d189f22851e7a1b8b1ad215dbaf7d8bee https://github.com/jenkinsci/scriptler-plugin/commit/ab3d736d189f22851e7a1b8b1ad215dbaf7d8bee Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-01 (Sun, 01 May 2022)
Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/scriptSettings.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/show.jelly A src/test/java/org/jenkinsci/plugins/scriptler/ScriptlerEncodingTest.java Log Message: ----------- JENKINS-59841: Use UTF-8 encoding to write scripts A change between Scriptler 2.9 and 3.1 changed the logic for reading scripts from the local disk so that it always used UTF-8 instead of the system's default encoding, but it did not change the character set used for writing. This can cause issues where the platform's default encoding was not UTF-8, as we could write scripts out with a different encoding than we read them in with. SpotBugs raised this use of the default encoding as a warning, but apparently was missed. Specifically use UTF-8 encoding to write scripts now so that we can now read and write scripts always with the same encoding, regardless of whether the system's default encoding changes or scripts are transferred between systems with different default encodings. Add a unit test to ensure that UTF-8 is used even if the default charset is different. Commit: c9ee54fdf75957d3d03121fe3e81acd1090b19dd https://github.com/jenkinsci/scriptler-plugin/commit/c9ee54fdf75957d3d03121fe3e81acd1090b19dd Author: Michael Tughan <mtug...@gmail.com> Date: 2022-05-01 (Sun, 01 May 2022) Changed paths: M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerManagement.java M src/main/java/org/jenkinsci/plugins/scriptler/ScriptlerPluginImpl.java M src/main/java/org/jenkinsci/plugins/scriptler/SyncUtil.java M src/main/java/org/jenkinsci/plugins/scriptler/share/gh/GHCatalog.java M src/main/java/org/jenkinsci/plugins/scriptler/util/ScriptHelper.java M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/scriptSettings.jelly M src/main/resources/org/jenkinsci/plugins/scriptler/ScriptlerManagement/scriptSettings.properties Log Message: ----------- Standardize file reading and writing - Introduce helper methods to read and write files that enforce the character set used, using the singleton for UTF-8 in StandardCharsets instead of retrieving it using Charsets.forName - Using the UTF-8 singleton in StandardCharsets whereever else the UTF-8 character set is referenced and used. - Where encoding is not under our control (i.e., the user uploads their own file to us), add a note saying that it should be encoded with UTF-8. Compare: https://github.com/jenkinsci/scriptler-plugin/compare/5b718a707d64...c9ee54fdf759 -- You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/scriptler-plugin/push/refs/heads/master/5b718a-c9ee54%40github.com.