JDK-4431398 : problems in displaying French characters in JDK 1.3.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.3.0
  • Priority: P1
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2001-03-29
  • Updated: 2001-04-05
  • Resolved: 2001-04-05
Related Reports
Relates :  
Relates :  
Description
The french characters are not coming up properly when customer use jdk1.3.

The french characters are read from the properties file and displayed on to
the browsers using servlets.Some characters come as "?" ( question marks).
The same thing seems to be working fine with the jdk1.2.2 version.
The current jdk1.3 that customer is using is:
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
On
SunOS 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-80

This problem DO NOT appear on any verion of jdk1.3 on NT.

Test case is as follows:

<frenchChar2File.java>

import java.io.*;
import java.util.*;
public class frenchChar2File
{


         public  static void main(String args[]) throws Exception
     {

           PropertyResourceBundle configBundle =
                        (PropertyResourceBundle)

PropertyResourceBundle.getBundle("CAS3LabelBundle_fr",
                        Locale.FRANCE);
           String DbName = configBundle.getString("ADD_SYSTEM_VARIABLES");
           String DbName1 = configBundle.getString("ADD_BIDDER");
           System.out.println(DbName);
           FileOutputStream fos = new FileOutputStream("frenchChars.txt");
           byte[] myBytes = DbName.getBytes() ;
           fos.write(myBytes);
           fos.close();
         }
}

<CAS3LabelBundle_fr.properties>

ADD=Ajouter^M
ADD_BIDDER=Ajouter un nouvel ench\351risseur^M
ADD_CATEGORY=Ajouter une nouvelle cat\351gorie^M
ADD_CURRENCY=Ajouter une nouvelle devise^M
ADD_NEW_PARAMETERS=Ajouter de nouveaux param\350tres^M
ADD_SYSTEM_VARIABLE=Ins\351rer^M
ADD_SYSTEM_VARIABLES=S\351lectionner l\'\351l\351ment de la vente \340 ins\351rer^M



Under Java version 1.3.0_02, I got the following output:

% javac frenchChar2File.java
% java frenchChar2File  
S?lectionner l'?l?ment de la vente ? ins?rer

Under Java version  1.2.1_04c, I got the following output:

% javac frenchChar2File.java
% java frenchChar2File     
S��lectionner l'��l��ment de la vente �� ins��rer

Comments
EVALUATION karl.hong@eng 2001-03-30 User is using 'C' locale to print French. The encoding or charset for 'C' locale is ASCII, which does not guarantee to be work for French language. The correct encoding for French is ISO8859-1, LC_CTYPE has to be set to either fr or en_US for using right encoding. I have talked to Karpe, who will contact the customers, suggest them to set LC_CTYPE to en_US. If solution is acceptable, the bug will be closed as 'not a bug' -------------------------------------------------------------------------- Not a bug. See 4388635 for a more detailed explanation. norbert.lindenberg@Eng 2001-04-05
05-04-2001