I need an help related to i18n (internationalization),…

http://www.mail-archive.com/user@struts.apache.org/msg72581.html

 

 

I am developing an application an struts application to be used in poland
for English,polish language on tomcat.

 

There is scenario to extract SAP messages and show to the user in browser in
JSP page.

 

I have written following method to read SAP message and Convert to IS0-559-2
charset( for Poland).

This is working for me on XP and Windows 2000 in Hyderabad.

 

 

I have used IS0-559-2 as encoding attribute in web.xml

And in JSP pages 

<%@ page contentType="text/html;charset=iso-8859-2"  %>

 

 

But messages are corrupted some times and getting Question marks when
deployed and tested application in Poland on Linux.

Linux- 

Nr potwierdzenia 8018340248 nie został znaleziony (proszę sprawdzić wpis)

 Windows

 

Nr potwierdzenia 2222222222 nie zosta³ znaleziony (proszê sprawdziæ wpis)

 

-----------------------------

 

private String convertTo_IS08559_2(HttpServletResponse response, String
strMessage) throws UnsupportedEncodingException{

            final String METHOD_NAME = "convertTo_IS08559_2() : ";  // holds
method name for logger messages

            String charset = response.getCharacterEncoding();

            String strFormatedMessage=null;     // holds formatted message

            

            Log.info(CLASS_NAME +" - " +METHOD_NAME+" - response -
"+response);

            Log.info(CLASS_NAME +" - " +METHOD_NAME+" - charset -
"+charset);

            Log.info(CLASS_NAME +" - " +METHOD_NAME+" - strMessage -
"+strMessage);

            

            if(strMessage!=null && strMessage.length()>0){

                  try {

                        strFormatedMessage = new
String(strMessage.getBytes(charset), "ISO-8859-2");

                  } catch (UnsupportedEncodingException e) {

                        // TODO Auto-generated catch block

                        //e.printStackTrace();

                        Log.error(CLASS_NAME +" - " +METHOD_NAME+" -
UnsupportedEncodingException - "+e);

                        throw e;

                  }

            } 

            Log.info(CLASS_NAME +" - " +METHOD_NAME+" - str -
"+strFormatedMessage);

            return strFormatedMessage;

      }

 

Reply via email to