Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 28012 invoked from network); 18 Feb 2008 14:41:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Feb 2008 14:41:34 -0000 Received: (qmail 70534 invoked by uid 500); 18 Feb 2008 14:41:20 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 70509 invoked by uid 500); 18 Feb 2008 14:41:20 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 70498 invoked by uid 99); 18 Feb 2008 14:41:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2008 06:41:19 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jak-struts-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Feb 2008 14:40:43 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JR7Am-0004Fc-Bg for user@struts.apache.org; Mon, 18 Feb 2008 14:40:48 +0000 Received: from cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com ([99.233.20.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Feb 2008 14:40:48 +0000 Received: from laurie by cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Feb 2008 14:40:48 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: user@struts.apache.org From: Laurie Harper Subject: Re: i18N jsp application on linux and windows Date: Mon, 18 Feb 2008 09:40:39 -0500 Lines: 135 Message-ID: References: <011501c87235$31c55bf0$67c013ac@pwit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1258; format=flowed Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) In-Reply-To: <011501c87235$31c55bf0$67c013ac@pwit.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Did you see my previous reply? http://www.nabble.com/i18N--jsp-application-on-linux-and-windows-tp154517= 35p15467087.html And for the record, your convertTo... method probably isn't doing the=20 right thing. If response.getCharacterEncoding() returns anything other=20 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=20 character set...! I'd start by ripping that code out all together. L. Raghuveer wrote: > I need an help related to i18n (internationalization),=85 >=20 > http://www.mail-archive.com/user@struts.apache.org/msg72581.html >=20 > =20 >=20 > =20 >=20 > I am developing an application an struts application to be used in pola= nd > for English,polish language on tomcat. >=20 > =20 >=20 > There is scenario to extract SAP messages and show to the user in brows= er in > JSP page. >=20 > =20 >=20 > I have written following method to read SAP message and Convert to IS0-= 559-2 > charset( for Poland). >=20 > This is working for me on XP and Windows 2000 in Hyderabad. >=20 > =20 >=20 > =20 >=20 > I have used IS0-559-2 as encoding attribute in web.xml >=20 > And in JSP pages=20 >=20 > <%@ page contentType=3D"text/html;charset=3Diso-8859-2" %> >=20 > =20 >=20 > =20 >=20 > But messages are corrupted some times and getting Question marks when > deployed and tested application in Poland on Linux. >=20 > Linux-=20 >=20 > Nr potwierdzenia 8018340248 nie zosta=C5=82 znaleziony (prosz=C4=99 spr= awdzi=C4=87 wpis) >=20 > Windows >=20 > =20 >=20 > Nr potwierdzenia 2222222222 nie zosta=B3 znaleziony (prosz=EA sprawdzi=E6= wpis) >=20 > =20 >=20 > ----------------------------- >=20 > =20 >=20 > private String convertTo_IS08559_2(HttpServletResponse response, String= > strMessage) throws UnsupportedEncodingException{ >=20 > final String METHOD_NAME =3D "convertTo_IS08559_2() : "; /= / holds > method name for logger messages >=20 > String charset =3D response.getCharacterEncoding(); >=20 > String strFormatedMessage=3Dnull; // holds formatted me= ssage >=20 > =20 >=20 > Log.info(CLASS_NAME +" - " +METHOD_NAME+" - response - > "+response); >=20 > Log.info(CLASS_NAME +" - " +METHOD_NAME+" - charset - > "+charset); >=20 > Log.info(CLASS_NAME +" - " +METHOD_NAME+" - strMessage - > "+strMessage); >=20 > =20 >=20 > if(strMessage!=3Dnull && strMessage.length()>0){ >=20 > try { >=20 > strFormatedMessage =3D new > String(strMessage.getBytes(charset), "ISO-8859-2"); >=20 > } catch (UnsupportedEncodingException e) { >=20 > // TODO Auto-generated catch block >=20 > //e.printStackTrace(); >=20 > Log.error(CLASS_NAME +" - " +METHOD_NAME+" - > UnsupportedEncodingException - "+e); >=20 > throw e; >=20 > } >=20 > }=20 >=20 > Log.info(CLASS_NAME +" - " +METHOD_NAME+" - str - > "+strFormatedMessage); >=20 > return strFormatedMessage; >=20 > } >=20 > =20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org