Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75956

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • job-dsl-plugin
    • None
    • Windows + Java21 (From Java17)

      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.

       

       

            jamietanna Jamie Tanna
            mokojarasi Hirofumi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: