Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 5036333
Votes 0
Synopsis There must be in the JNLP file a way to specify the file.encoding property
Category javawebstart:jnlp_file
Reported Against 1.4.2
Release Fixed
State 11-Closed, duplicate of 4163515, request for enhancement
Priority: 4-Low
Related Bugs 4163515
Submit Date 22-APR-2004
Description




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) 
======================================================================
Work Around
N/A
Evaluation
file.encoding should be added to the list of "trusted" properties.
  xxxxx@xxxxx   2004-05-26

in accordance with the comments of   xxxxx@xxxxx  , on bug 4163515, I am closing this as a dupe of 4163515
Comments
  
  Include a link with my name & email   

Submitted On 22-JUL-2004
bachand
Hey guys, this is ridiculous. How many of you have done end-to-end internationalization of a product? How feasible is it to store files for different locales in the formats dictated by a committee somewhere?

We are putting together an end-to-end translation process. Our database content is stored in UTF-8. We would like to store our property files in the same format. 

We are running tomcat and java. If we are unable to set the file.encoding parameter, then how do you suggest that we read en_US files stored as UTF-8? Are we going to need an ant script that inspects the locale on each property file and converts the file appropriately?



PLEASE NOTE: JDK6 is formerly known as Project Mustang