• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • 2.358

      Property files for localization requires to be encoded in ISO-8859-1.
      It results difficulties in reviewing localizing pull requires such as https://github.com/jenkinsci/maven-plugin/pull/86.
      It would be nice if property files in source directories can be written in UTF-8 letters.

      There are two approaches:

      1. Encode property files when compiling.
        • maven-resources-plugin copies files in the resources directory into the target directory. It doesn't provide a feature to encode property files.
        • Though native2ascii-maven-plugin encodes property files, it is provided only as beta for long time.
          • This might mean encoding property files in compilation time isn't a standard approach.
        • maven-antrun-plugin can run native2ascii (But it feels strange approach to me).
        • This approach would cause problems when testing plugins with "mvn hpi:run".
          • As property files aren't compiled and read from source directories directly at that time.
      2. Make libraries reading property files accept UTF-8 letters.

      Actually, I'm not sure this is a good idea.
      I created this ticket and will create pull requests to request comments about this idea.

          [JENKINS-41729] Using utf-8 letters in property files

          ikedam added a comment - - edited

          ikedam added a comment - - edited https://github.com/stapler/stapler/pull/105

          ikedam added a comment -

          The apparent problem is assuming that encoding is always UTF-8.

          ikedam added a comment - The apparent problem is assuming that encoding is always UTF-8.

          ikedam added a comment -

          I found existing property files are not encoded in ASCII, but ISO-8859-1.
          See more details in https://github.com/stapler/stapler/pull/105.
          ISO-8859-1 and UTF-8 are not compatible, and it looks difficult to detect decoding errors in Java.

          It would be better to consider using XML property files: https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#loadFromXML-java.io.InputStream-

          ikedam added a comment - I found existing property files are not encoded in ASCII, but ISO-8859-1. See more details in https://github.com/stapler/stapler/pull/105 . ISO-8859-1 and UTF-8 are not compatible, and it looks difficult to detect decoding errors in Java. It would be better to consider using XML property files: https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#loadFromXML-java.io.InputStream-

          ikedam added a comment -

          ikedam added a comment - https://github.com/stapler/stapler/pull/171

          ikedam added a comment -

          ikedam added a comment - https://github.com/kohsuke/localizer/pull/20

          Jesse Glick added a comment -

          Probably requires a dev list discussion as to whether we want to be hosting non-English translations in feature repositories (as opposed to translation repositories), and in either case whether XML is the best format.

          Jesse Glick added a comment - Probably requires a dev list discussion as to whether we want to be hosting non-English translations in feature repositories (as opposed to translation repositories), and in either case whether XML is the best format.

          Oleg Nenashev added a comment -

          IIUC we can close it now with the Jenkins core release. Or not?

          Oleg Nenashev added a comment - IIUC we can close it now with the Jenkins core release. Or not?

          Jesse Glick added a comment -

          Is this actually available now in core? Would like to see at least some, if not all, *.properties converted accordingly.

          Jesse Glick added a comment - Is this actually available now in core? Would like to see at least some, if not all, *.properties converted accordingly.

          Jesse Glick added a comment -

          https://github.com/stapler/stapler/pull/171 remains open, so no this should not be closed now.

          Jesse Glick added a comment - https://github.com/stapler/stapler/pull/171 remains open, so no this should not be closed now.

          Tim Jacomb added a comment -

          Once we change our baseline to Java 11 we can finish this off, the code is in place and will automatically work on 11.

           

          We will need to remove the 'maven-encoding-plugin' which only allows ascii text, and then convert existing files to utf-8

          Tim Jacomb added a comment - Once we change our baseline to Java 11 we can finish this off, the code is in place and will automatically work on 11.   We will need to remove the 'maven-encoding-plugin' which only allows ascii text, and then convert existing files to utf-8

            timja Tim Jacomb
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: