United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5036333 There must be in the JNLP file a way to specify the file.encoding property
JDK-5036333 : There must be in the JNLP file a way to specify the file.encoding property

Details
Type:
Enhancement
Submit Date:
2004-04-22
Status:
Closed
Updated Date:
2004-08-27
Project Name:
JDK
Resolved Date:
2004-08-27
Component:
deploy
OS:
windows_nt
Sub-Component:
webstart
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.4.2
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

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) 
======================================================================

                                    

Comments
EVALUATION

file.encoding should be added to the list of "trusted" properties.
###@###.### 2004-05-26

in accordance with the comments of ###@###.###, on bug 4163515, I am closing this as a dupe of 4163515
                                     
2004-05-26



Hardware and Software, Engineered to Work Together