Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 54107 invoked from network); 15 May 2005 16:01:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 May 2005 16:01:59 -0000 Received: (qmail 38204 invoked by uid 500); 15 May 2005 16:04:55 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 37302 invoked by uid 500); 15 May 2005 16:04:44 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 36459 invoked by uid 99); 15 May 2005 16:04:33 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=FORGED_RCVD_HELO,FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from basistech.com (HELO mail1.basistech.net) (199.88.205.1) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 15 May 2005 09:04:32 -0700 Received: from mail3.basistech.net ([10.1.1.99]) by mail1.basistech.net with Microsoft SMTPSVC(6.0.3790.211); Sun, 15 May 2005 11:59:44 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Arabic encoding Date: Sun, 15 May 2005 11:59:43 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Arabic encoding Thread-Index: AcVYQVcj/aMDZQkcTJuEeFOHoO4cRABJZyMA From: "Benson Margulies" To: "Tomcat Users List" X-OriginalArrivalTime: 15 May 2005 15:59:44.0034 (UTC) FILETIME=[1C3F4820:01C55967] X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Why do you expect this to work with the us7 oracle encoding? The JDBC driver will work very hard to force all your Arabic characters to turn into ? marks with this configuration. You must use UTF-8 or CP1256 or ISO-8869-6 in Oracle. -----Original Message----- From: Fadwa Barham [mailto:fsbarham@yahoo.com]=20 Sent: Saturday, May 14, 2005 12:56 AM To: Tomcat Users List Subject: Re: Arabic encoding thanks for your reply. =20 I agree with you that utf-8 encoding is suitable for all cases, but in tc4 with jdk1.3, I write the servlets and compile them and use data from oracle with us7ascii encoding, and I don't set any encoding except: pw.println(""); pw.println(""); and the page display all the characters correctly. I think sun microsystems and tomcat made changes to the new packages about encoding. but how to deal with the new changed? Is there special setup I've to do? =20 thanks=20 Fadwa Mark Thomas wrote: There are lots of potential pitfalls when using non-default character=20 encodings. It is easy to make mistakes both with Tomcat settings and=20 with your code. To sort out the tomcat settings, get the following index.jsp to work for whatever text you supply to the form. I have tested this with the latest TC4 and TC5 code and it works for me with any text I choose to enter. Once you have this working, you can look at your application and see=20 what is different. Mark Data posted to this form was: request.setCharacterEncoding("UTF-8"); out.print(request.getParameter("mydata")); %> enctype=3D"application/x-www-form-urlencoded"> [input]=20 [input]=20 [input]=20 Fadwa Barham wrote: > While I was searching for a solution for the encoding, I found this >=20 > There is a standard for encoding URIs (http://www.w3.org/International/O-URL- > code.html) but this standard is not consistently followed by clients. This=20 > causes a number of problems. >=20 > The functionality provided by Tomcat (4 and 5) to handle this less than ideal=20 > situation is described below. >=20 > 1. The Coyote HTTP/1.1 connector has a useBodyEncodingForURI attribute which=20 > if set to true will use the request body encoding to decode the URI query=20 > parameters. > - The default value is true for TC4 (breaks spec but gives consistent=20 > behaviour across TC4 versions) > - The default value is false for TC5 (spec compliant but there may be=20 > migration issues for some apps) > 2. The Coyote HTTP/1.1 connector has a URIEncoding attribute which defaults to=20 > ISO-8859-1. > 3. The parameters class (o.a.t.u.http.Parameters) has a QueryStringEncoding=20 > field which defaults to the URIEncoding. It must be set before the parameters=20 > are parsed to have an effect. >=20 > Things to note regarding the servlet API: > 1. HttpServletRequest.setCharacterEncoding() normally only applies to the=20 > request body NOT the URI. > 2. HttpServletRequest.getPathInfo() is decoded by the web container. > 3. HttpServletRequest.getRequestURI() is not decoded by container. >=20 > Other tips: > 1. Use POST with forms to return parameters as the parameters are then part of=20 > the request body. >=20 >=20 > Is this means that the changes between tc4 and tc5 about encoding is the reason why I can't have the write encoding in the new versions of tomcat? and if so, how to solve the problem? >=20 > Thanks >=20 > ----- Original Message -----=20 > From: "Fadwa Barham"=20 > To: "Tomcat Users List"=20 > Sent: Tuesday, March 01, 2005 3:24 AM > Subject: Re: Arabic encoding >=20 >=20 >=20 >>As tomcat 4.1.31 is suitable for arabic and it seems until now that tomcat=20 >>4.1.31 solved the jndi datasource problems: Intermittent dB connection >>Failures and Random Connection closed Exceptions >>I will use tomcat 4.1.31 until I can configure the latest versions of=20 >>tomcat. >>I feel not lucky >>----- Original Message -----=20 >>From: "Fadwa Barham"=20 >>To: "Tomcat Users List"=20 >>Sent: Tuesday, March 01, 2005 2:39 AM >>Subject: Re: Arabic encoding >> >> >> >>>I tested many tomcat versions, I found until tomcat 4.1.31 no problems=20 >>>with arabic, but when I tried tomcat-4.1.18 and newer versions, I faced=20 >>>the same problem. >>> >>>----- Original Message -----=20 >>>From: "Benson Margulies"=20 >>>To: "Tomcat Users List"=20 >>>Sent: Sunday, February 27, 2005 4:08 PM >>>Subject: RE: Arabic encoding >>> >>> >>> >>>>It depends on what the Oracle JDBC driver does with byte values that are >>>>not legitimate US7ASCII. If, for some reason, it treated the data as >>>>ISO-8859-1 instead of US7ASCII, then it might have streamed out through >>>>tomcat, and the browser would have auto-detected the CP1256 pretending >>>>to be ISO-8859-1. >>>> >>>>-----Original Message----- >>>>From: Fadwa Barham [mailto:fadwa@najah.edu] >>>>Sent: Sunday, February 27, 2005 1:43 PM >>>>To: Tomcat Users List >>>>Subject: Re: Arabic encoding >>>> >>>>But I wonder why the old tomcat and java displayed arabic correctly, and >>>>I use the same classes12.jar in both of the old and the new. >>>>I want to know what is the differance, what encoding they stopped to >>>>support? It looks like that tomcat cannot understand the old Java cause >>>>I have to change the encoding to arabic windows in the internet explorer >>>>each time I request the servlet, and when I do this, every arabic >>>>character is displayed correctly. >>>>I think it is better to understand the problem and the changes so I can >>>>handle the problem if I faced it again in the newer versions of tomcat >>>>or Java. >>>>I know that being the database in us7ascii is not good, but changing the >>>>database encoding each time I face the problem is not the right way. I >>>>may change it this time, but I need to understand. >>>>thanks >>>> >>>>----- Original Message ----- >>>>From: "Benson Margulies"=20 >>>>To: "Tomcat Users List"=20 >>>>Sent: Sunday, February 27, 2005 12:44 AM >>>>Subject: RE: Arabic encoding >>>> >>>> >>>> >>>>>Oracle's ODBC driver will transcode from the database to UTF-16 based >>>> >>>>on >>>> >>>>>the databse encoding. If the database is in US7ASCII, this is a >>>>>destructive process for Arabic. The only alternative I can think of is >>>>>to do all your database I/O in hex. >>>>> >>>>>-----Original Message----- >>>>>From: Fadwa Barham [mailto:fadwa@najah.edu] >>>>>Sent: Saturday, February 26, 2005 1:20 PM >>>>>To: Tomcat Users List >>>>>Subject: Re: Arabic encoding >>>>> >>>>>I use oracle 7 database, and the NLS language is >>>>>American_America.US7ASCII, and it is not easy to change it to utf-8. >>>>>Beside, the question is, a servlet work fine on tomcat 4.0.6 why it >>>>>stopped with the new versions, what changes made to the encoding of >>>>>tomcat?? >>>>>do I need tomcat-i18n-ar.jar? and if so, from where to get it? >>>>>I can't determine where is the problem, is it from the new Java or the >>>>>new tomcat. >>>>>thanks in advanced >>>>> >>>>>----- Original Message ----- >>>>>From: "Benson Margulies"=20 >>>>>To: "Tomcat Users List"=20 >>>>>Sent: Wednesday, February 23, 2005 11:26 PM >>>>>Subject: RE: Arabic encoding >>>>> >>>>> >>>>> >>>>>>What database? Do you have the database set up to deliver Unicode, or >>>>>>CP1256, correctly? Note that not all Arabic fits into CP1256, you >>>>> >>>>>might >>>>> >>>>>>really be better off with UTF-8. >>>>>> >>>>>>------------------------------------------------------------------ --- >>>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>>>>> >>>>> >>>>> >>>>>------------------------------------------------------------------- -- >>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>>>> >>>>> >>>>>------------------------------------------------------------------- -- >>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>>>> >>>> >>>> >>>>-------------------------------------------------------------------- - >>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>>> >>>> >>>>-------------------------------------------------------------------- - >>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >>>> >>> >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org=20 >=20 >=20 >=20 >=20 > --------------------------------- > Yahoo! Mail Mobile > Take Yahoo! Mail with you! Check email on your mobile phone. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around=20 http://mail.yahoo.com=20 --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org