Re: i18N jsp application on linux and windows

2008-02-19 Thread Laurie Harper

Raghuveer wrote:

Hello Lauri,

This is with reference..

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

[...]

response.getCharacterEncoding()is returning ISO-8859-1.

I have set it to charset - ISO-8859-2 in JSP pages but it is returning
“charset - ISO-8859-1”.


Then you have something missing somewhere; from my first reply which you 
didn't answer:


 I have set ISO8859_2 in JSP page for charset.

 %@ page contentType=text/html;charset=ISO8859_2  %

This tells the JSP engine what character encoding to use. Do you also 
have an HTML meta http-equiv tag in the head of your page to tell the 
browser what encoding it should use to process the page?


When the browser submits a form, it should use the character encoding of 
the page that the form is in. If that's not working, start by fixing that.



Same thing is happening in windows and Linux.

It is working in windows with this conversion(convertTo_IS08559_2) but
failing in Linux..


As I said, the conversion code you have is semantically incorrect and 
shouldn't be necessary anyway. Remove it and fix the issue above and see 
where you are then.


L.


Regards,
Raghu

 

 

  _  

From: Laurie Harper [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 19, 2008 4:24 AM

To: [EMAIL PROTECTED]
Subject: Re: i18N jsp application on linux and windows

 


Uh, yeah, I got that; that's why I've replied to you twice, on the list; see
also: 

 


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

 


Please follow up on-list if you need further help, to keep the discussion
where everyone can see it.

 


L.

 


On 18-Feb-08, at 8:50 AM, Raghuveer wrote:





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

 http://www.mail-archive.com/user@struts.apache.org/msg72581.html
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
charsetThis is working for me on XP and Windows 2000 in Hyderabad.

IS0-559-2And 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 22 nie zosta³ znaleziony (proszê sprawdziæ wpis)

 


-

 


String convertTo_IS08559_2(HttpServletResponse response, StringstrMessage)
throws UnsupportedEncodingException{

String charset = response.getCharacterEncoding();

   


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

   


  try {

  } catch (UnsupportedEncodingException e) {

//e.printStackTrace();

throw e;

}

return strFormatedMessage;






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18N jsp application on linux and windows

2008-02-18 Thread Raghuveer
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 22 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;

  }

 



Re: i18N jsp application on linux and windows

2008-02-18 Thread Laurie Harper

Did you see my previous reply?

http://www.nabble.com/i18N--jsp-application-on-linux-and-windows-tp15451735p15467087.html

And for the record, your convertTo... method probably isn't doing the 
right thing. If response.getCharacterEncoding() returns anything other 
than ISO-8859-2, your code will corrupt the string since it's explicitly 
trying to apply ISO-8859-2 encoding to a set of bytes in a different 
character set...! I'd start by ripping that code out all together.


L.

Raghuveer wrote:

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 22 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;

  }

 







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: i18N jsp application on linux and windows

2008-02-18 Thread Raghuveer
Hello Lauri,

This is with reference..

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

 

Your reply on list is helping me a lot to dig into the problem.Please
continue your help .

 

response.getCharacterEncoding()is returning ISO-8859-1.

 

I have set it to charset - ISO-8859-2 in JSP pages but it is returning
“charset - ISO-8859-1”.

Same thing is happening in windows and Linux.

It is working in windows with this conversion(convertTo_IS08559_2) but
failing in Linux..

 

 

Regards,
Raghu

 

 

  _  

From: Laurie Harper [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 19, 2008 4:24 AM
To: [EMAIL PROTECTED]
Subject: Re: i18N jsp application on linux and windows

 

Uh, yeah, I got that; that's why I've replied to you twice, on the list; see
also: 

 

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

 

Please follow up on-list if you need further help, to keep the discussion
where everyone can see it.

 

L.

 

On 18-Feb-08, at 8:50 AM, Raghuveer wrote:





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

 http://www.mail-archive.com/user@struts.apache.org/msg72581.html
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
charsetThis is working for me on XP and Windows 2000 in Hyderabad.

IS0-559-2And 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 22 nie zosta³ znaleziony (proszê sprawdziæ wpis)

 

-

 

String convertTo_IS08559_2(HttpServletResponse response, StringstrMessage)
throws UnsupportedEncodingException{

String charset = response.getCharacterEncoding();

   

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

   

  try {

  } catch (UnsupportedEncodingException e) {

//e.printStackTrace();

throw e;

}

return strFormatedMessage;



Re: i18N jsp application on linux and windows

2008-02-13 Thread Nuwan Chandrasoma

Hi,

Why dont you try putting UTF-8, i think this character set is not in 
Linux may be.


Thanks,

Nuwan.

Raghuveer wrote:
 


This is regarding the damage of polish messages from struts application
deployed on Tomcat on Linux and Windows XP .

 


I get polish messages from SAP that to be displayed in JSP page.

 


I have set ISO8859_2 in JSP page for charset.

 


%@ page contentType=text/html;charset=ISO8859_2  %

 

I have set  encoding attribute in web.xml as below 


?xml version=1.0 encoding=ISO-8859-2?

 

 


This is working on Windows XP.

 


But I get Question marks and differents characters for polish messages from
application deployed on Linux

 


prosz? sprawdzi? Wpis.

 


Please help if I need to do anything in framework..


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18N jsp application on linux and windows

2008-02-13 Thread Laurie Harper

Raghuveer wrote:

This is regarding the damage of polish messages from struts application
deployed on Tomcat on Linux and Windows XP .

I get polish messages from SAP that to be displayed in JSP page.

I have set ISO8859_2 in JSP page for charset.

%@ page contentType=text/html;charset=ISO8859_2  %


This tells the JSP engine what character encoding to use. Do you also 
have an HTML meta http-equiv tag in the head of your page to tell the 
browser what encoding it should use to process the page?


I have set  encoding attribute in web.xml as below 


?xml version=1.0 encoding=ISO-8859-2?


Err, that just tells the servlet container what character encoding to 
use when reading web.xml. Unless you need to include Polish language 
text in your web.xml file, it's not relevant.



This is working on Windows XP.

But I get Question marks and differents characters for polish messages from
application deployed on Linux


Probably the Windows and Linux machines have different default (system) 
locales configured and there is some point in your app where the default 
character encoding is being used and needs to be specified explicitly.


Check if the Polish language data is being retrieved correctly from SAP 
on the Linux deployment (i.e. is it correct when your action receives 
it); failiing that, use Firebug or a packet sniffer like Ethereal to 
look at what's going over the wire: is the HTTP response encoded correctly?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]