Details

    • Similar Issues:

      Description

      It would be nice if the readFile basic step could recognize the file's encoding.  (Writing a file with writeFile can store a BOM at the beginning to help in recognizing the character set later, but this must be only a non-default option to preserve backward compatibility with earlier groovy code reading the created files.  This agrees with a rule of thumb "accept liberally, produce conservatively").

      There is no need to reinvent the wheel.  Using (and white-listing) groovy.util.CharsetToolkit can make this easy.

       

      https://github.com/groovy/groovy-core/blob/GROOVY_2_4_X/src/main/groovy/util/CharsetToolkit.java#L388

       

      http://docs.groovy-lang.org/latest/html/api/groovy/util/CharsetToolkit.html#getReader()

       

      https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/workflow-basic-steps-2.18/src/main/java/org/jenkinsci/plugins/workflow/steps/ReadFileStep.java

       

        Attachments

          Activity

          Hide
          ilatypov Ilguiz Latypov added a comment -

          Related to JENKINS-53901.

          Show
          ilatypov Ilguiz Latypov added a comment - Related to JENKINS-53901 .

            People

            • Assignee:
              Unassigned
              Reporter:
              ilatypov Ilguiz Latypov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: