Need to Specify File Encoding in readFileFromWorkspace on Windows When Using Java 21

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      With the announcement that Jenkins will raise its minimum supported Java version from 17 to 21, I conducted compatibility testing. I encountered errors with ‎'readFileFromWorkspace'. The root cause is that, starting with Java 18, the default charset became OS-independent (UTF-8),  which led to issues on Windows environments.

      I believe that 'readFileFromWorkspace' should allow specifying Charset as an optional argument, enabling consistent behavior on both Java 17 and Java 21. I am also preparing a pull request on GitHub and would appreciate a review.

       

       

            Assignee:
            Jamie Tanna
            Reporter:
            Hirofumi
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: