Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5036333

There must be in the JNLP file a way to specify the file.encoding property

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • deploy
    • x86
    • windows_nt



      Name: rmT116609 Date: 04/22/2004


      A DESCRIPTION OF THE REQUEST :
      Since JVM1.4.2, file.encoding property is read only (see bug 4163515) :
      it can be changed but will not affect the behaviour of encoding/decoding.

      However, many applications need a way to specify with which file.encoding they must be launched (for example UTF8).

      Before JVM 1.4.2, developers were able to specify a system property in the jnlp file:

      <j2se version="1.4"/>
      <property name="file.encoding" value="UTF8"/>

      but in 1.4.2 jvm, this does not work.
      The property is not passed on the command line (-Dfile.encoding=value)
      and then has no effect on encodig/decoding.

      So since 1.4.2, there is no way to specify the encoding that must be used with the application, within the JNLP file.

      JUSTIFICATION :
      Many applications rely on a specific encoding (usually UTF8, ISO etc). These applications that are deployed with Java Web Start must be able to to specify in the JNLP file the encoding.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The JNLP file must define a way to define the encoding : two possible choices :

      1/
      <j2se version="1.4"/>
      <property name="file.encoding" value="UTF8"/>

      Java web start will detect that file.encoding is a special system property and then must launched the JVM with -Dfile.encoding=UTF8 instead of doing a System.setProperty("file.encoding", "UTF8")

      2/ a new parameter is included in the j2se jnlp tag :

      <j2se version="1.4" file-encoding="UTF8"/>

      and then the jvm will be started with -Dfile.encoding="UTF8" param.
      Personnaly, I prefer this solution rather than the first one, because in jvm 1.4.2 file.encoding is not just a simple system property but a jvm param representation.

      ACTUAL -
      In JVM 1.4.1, setting
      <property name="file.encoding" value="UTF8"/>
      works fine

      In JVM 1.4.2 it has not effect on the encoding behaviour

      ---------- BEGIN SOURCE ----------
      The simplest way to test is to create a small UTF8 file that will contain french character and greek character.

      This file is read, decoded, and then saved. Normally, if the JVM is using the UTF8 encoding, the output file and input file must be exactly the same. If another encoding is used, greek character will be replaced by '?' characters in the output file.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use JVM 1.4.1 and set <property name="file.encoding" value="UTF8"/> in the JNLP file.

      No workaround known with jvm 1.4.2 and later.
      (Incident Review ID: 233430)
      ======================================================================

            herrick Andy Herrick (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: