0 Replies Latest reply on Feb 7, 2008 5:52 PM by 807603

    Encoding of java string into euc-jp results in a string of question marks


      I am developing a java web application that has to display japanse (Kanji) characters. The contents are retrieved from the DB (sybase), encoded using euc-jp and written into an HTML file on the server by a java program. These 'cached' HTML files are picked up to be displayed on the browser. The code that I am using to do the encoding is as below
                    strDataFromDB = getDateFromDB();
                    encodedString = new String(strDataFromDB, 'euc-jp');
                    System.out.println("encodedString is " + encodedString);              
             catch (UnsupportedEncodingException ex)
               /* Code to write encodedString into the HTML file goes here */
      However the encodedString value is generated as a string of ???? characters. This behaviour is observed only in our production environment. The test environment does the encoding properly even when connected to the production DB.

      Am using the following versions

      Server - Red Hat Linux 3.0
      App server - Tomcat
      JRE - 1.4.2_11

      Can somebody help me finding what is going wrong ? Is there any dependancy of the encoding process on some OS parameter that I need to check ?

      Thanks in advance,