Re: Servlet on Tomcat + Oracle +ISU 8859-8 (Hebrew CharSet) - encodin g problem

2004-04-02 Thread Veniamin Fichin
Hi there.

   May be this bug report 
http://issues.apache.org/bugzilla/show_bug.cgi?id=23929 will enlighten 
you, me and others who have issues with i18n. Very professional 
explanation of the problem, thanks to Remy.

[EMAIL PROTECTED] wrote:

The problem:
I am using Oracle 8.1.7 DB , in a Charest ISU 8859-9-8 ( Hebrew ), I use a
thin client as the JDBC driver .
I have a servlet that all it does is getting and updating one of the table
cut/
I  use the doGet method of a servlet to get parameters to retrieve from
Oracle. this is done through the URL, for example :
I send the parameters like this :
http://localhost:8080/myapp/myapp?name=yair
http://localhost:8080/myapp/myapp?name=yairfamily=fine family=fine
for name= yair, family = fine
 
There is no problem in getting and inserting English characters.
There is a problem when i try to get or to insert Hebrew characters.
i get  in DB , for both if i write yair in the url in Hebrew , or i
write yair in %E9%E9%E9%F8 which is the decimal representation 
 
For example , if i insert a string in Hebrew , it looks like this ? (
in SQL +)
 
this is how i get the requests from the url
Enumeration paramEnum = request.getParameterNames(); // get request
parameters from the url , in param/value pairs
String myParam = (String) paramEnum.nextElement(); //get parameter
String myValue = request.getParameter(myParam);  //get value
 
String myStatment = insert into mytable values('19', '+myValue+') insert
to table 19 , myvalue
ResultSet rs = stmt.executeQuery(myStatment);
 
does any one have a solution for that ?


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


Re: Servlet on Tomcat + Oracle +ISU 8859-8 (Hebrew CharSet) - encodin g problem

2004-03-31 Thread Veniamin Fichin
This is my problem also, and sadly it's so since long time I use Tomcat.

   I've attach a simple little test case .war file to reproduce the 
problem. There are four HTML forms there, two of them submits to JSP 
page (GET and POST methods), others go to servlet (same methods).
   On top of it is a select field allowing to define an encoding for 
future submits. It acts as following: after choosing it and submitting 
that select the JSP page is reloaded with that encoding, setting its 
response.setContentType() and setting session attribute named 
tHAVW07QUf (for uniqueness, see below). Now, one can submit any form 
presented below.
   I've deployed a filter.SetCharacterEncodingFilter (taken from 
standard Tomcat distribution), with one modification: during every 
request it reads session attribute tHAVW07QUf and sets requests' 
encoding accordingly. If that attribute is absent, it reads its init 
parameter given in web.xml as usually. So, instead of hard-coding 
character incoding in web.xml, I can set it online. According to 
filters.RequestDumperFilter (also Tomcat's standard filter) it works.
   So, let's see what we have here. The result on my machine is that 
any GET methods produces broken output of the parameter passed as 
URL-encoded %XX%XX%XX string, actual encoding of which is set by select 
box on the first page. Any combinations of encoding, submit methods and 
target actions (JSP or Servlet) give me broken output, except two of 
them -- utf-8 POST to JSP and utf-8 POST to Servlet.
   I looked at Tomcat's some source files, namely 
org.apache.catalina.util.RequestUtil.URLDecode(byte[], String) and 
org.apache.catalina.util.RequestUtil.parseParameters(java.util.Map, 
byte[], String), and see how url-encoded request parameters are parsed, 
but I don't know if it's the right place to see.
   Ah, and one note. I tried to run Tomcat with 
-Dfile.encoding=koi8-r option to set default byte[]-String conversion 
mapping to koi8-r (for example), and even this does not help me much, 
though it sets the new default.
   This behaviour was there on 4.x and 5.x versions, seems like nothing 
is changing.

   I don't state that I've done all tests correctly, so in any error 
please fix my mind. The only question is: how one can universally and 
correctly handle non-ASCII request parameters and get rightly decoded 
output?

[EMAIL PROTECTED] wrote:

Hi all ,
i have a problem with encoding and decoding, from a servlet , running on
Tomcat , to Oracle DB.
I hope it is the right forum for that , and i appologize if ti is not ..
 
The problem:
I am using Oracle 8.1.7 DB , in a Charest ISU 8859-9-8 ( Hebrew ), I use a
thin client as the JDBC driver .
I have a servlet that all it does is getting and updating one of the table
 
The character set in the servlet is too , ISO 8859-8 . This is done this
way:
 
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
  request.setCharacterEncoding(ISO-8859-8);
  response.setContentType(Text/html; ISO-8859-8);
  .
} 

I  use the doGet method of a servlet to get parameters to retrieve from
Oracle. this is done through the URL, for example :
I send the parameters like this :
http://localhost:8080/myapp/myapp?name=yair
http://localhost:8080/myapp/myapp?name=yairfamily=fine family=fine
for name= yair, family = fine
 
There is no problem in getting and inserting English characters.
There is a problem when i try to get or to insert Hebrew characters.
i get  in DB , for both if i write yair in the url in Hebrew , or i
write yair in %E9%E9%E9%F8 which is the decimal representation 
 
For example , if i insert a string in Hebrew , it looks like this ? (
in SQL +)

 
this is how i get the requests from the url
Enumeration paramEnum = request.getParameterNames(); // get request
parameters from the url , in param/value pairs
String myParam = (String) paramEnum.nextElement(); //get parameter
String myValue = request.getParameter(myParam);  //get value
 
String myStatment = insert into mytable values('19', '+myValue+') insert
to table 19 , myvalue
ResultSet rs = stmt.executeQuery(myStatment);
 
does any one have a solution for that ?



charset.renametowar.gz
Description: GNU Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

[Fwd: Re: Servlet on Tomcat + Oracle +ISU 8859-8 (Hebrew CharSet) - encodin g problem]

2004-03-31 Thread Veniamin Fichin
   Some fixes to WAR file posted recently. Now POST methods all work 
fine, but none of GET.

 Original Message 
Subject: Re: Servlet on Tomcat + Oracle +ISU 8859-8 (Hebrew CharSet) - 
encodin g problem
Date: Wed, 31 Mar 2004 14:34:27 +0400
From: Veniamin Fichin [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
References: [EMAIL PROTECTED]

This is my problem also, and sadly it's so since long time I use Tomcat.

I've attach a simple little test case .war file to reproduce the
problem. There are four HTML forms there, two of them submits to JSP
page (GET and POST methods), others go to servlet (same methods).
On top of it is a select field allowing to define an encoding for
future submits. It acts as following: after choosing it and submitting
that select the JSP page is reloaded with that encoding, setting its
response.setContentType() and setting session attribute named
tHAVW07QUf (for uniqueness, see below). Now, one can submit any form
presented below.
I've deployed a filter.SetCharacterEncodingFilter (taken from
standard Tomcat distribution), with one modification: during every
request it reads session attribute tHAVW07QUf and sets requests'
encoding accordingly. If that attribute is absent, it reads its init
parameter given in web.xml as usually. So, instead of hard-coding
character incoding in web.xml, I can set it online. According to
filters.RequestDumperFilter (also Tomcat's standard filter) it works.
So, let's see what we have here. The result on my machine is that
any GET methods produces broken output of the parameter passed as
URL-encoded %XX%XX%XX string, actual encoding of which is set by select
box on the first page. Any combinations of encoding, submit methods and
target actions (JSP or Servlet) give me broken output, except two of
them -- utf-8 POST to JSP and utf-8 POST to Servlet.
I looked at Tomcat's some source files, namely
org.apache.catalina.util.RequestUtil.URLDecode(byte[], String) and
org.apache.catalina.util.RequestUtil.parseParameters(java.util.Map,
byte[], String), and see how url-encoded request parameters are parsed,
but I don't know if it's the right place to see.
Ah, and one note. I tried to run Tomcat with
-Dfile.encoding=koi8-r option to set default byte[]-String conversion
mapping to koi8-r (for example), and even this does not help me much,
though it sets the new default.
This behaviour was there on 4.x and 5.x versions, seems like nothing
is changing.
I don't state that I've done all tests correctly, so in any error
please fix my mind. The only question is: how one can universally and
correctly handle non-ASCII request parameters and get rightly decoded
output?
[EMAIL PROTECTED] wrote:

Hi all ,
i have a problem with encoding and decoding, from a servlet , running on
Tomcat , to Oracle DB.
I hope it is the right forum for that , and i appologize if ti is not ..
 
The problem:
I am using Oracle 8.1.7 DB , in a Charest ISU 8859-9-8 ( Hebrew ), I use a
thin client as the JDBC driver .
I have a servlet that all it does is getting and updating one of the table
 
The character set in the servlet is too , ISO 8859-8 . This is done this
way:
 
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
  request.setCharacterEncoding(ISO-8859-8);
  response.setContentType(Text/html; ISO-8859-8);
  .
} 

I  use the doGet method of a servlet to get parameters to retrieve from
Oracle. this is done through the URL, for example :
I send the parameters like this :
http://localhost:8080/myapp/myapp?name=yair
http://localhost:8080/myapp/myapp?name=yairfamily=fine family=fine
for name= yair, family = fine
 
There is no problem in getting and inserting English characters.
There is a problem when i try to get or to insert Hebrew characters.
i get  in DB , for both if i write yair in the url in Hebrew , or i
write yair in %E9%E9%E9%F8 which is the decimal representation 
 
For example , if i insert a string in Hebrew , it looks like this ? (
in SQL +)

this is how i get the requests from the url
Enumeration paramEnum = request.getParameterNames(); // get request
parameters from the url , in param/value pairs
String myParam = (String) paramEnum.nextElement(); //get parameter
String myValue = request.getParameter(myParam);  //get value
 
String myStatment = insert into mytable values('19', '+myValue+') insert
to table 19 , myvalue
ResultSet rs = stmt.executeQuery(myStatment);
 
does any one have a solution for that ?




charset.renametowar.gz
Description: GNU Zip compressed data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Servlet on Tomcat + Oracle +ISU 8859-8 (Hebrew CharSet) - encodin g problem

2004-03-30 Thread yair . fine
Hi all ,
i have a problem with encoding and decoding, from a servlet , running on
Tomcat , to Oracle DB.
I hope it is the right forum for that , and i appologize if ti is not ..
 
The problem:
I am using Oracle 8.1.7 DB , in a Charest ISU 8859-9-8 ( Hebrew ), I use a
thin client as the JDBC driver .
I have a servlet that all it does is getting and updating one of the table
 
The character set in the servlet is too , ISO 8859-8 . This is done this
way:
 
public void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException, IOException {
  
  request.setCharacterEncoding(ISO-8859-8);
  response.setContentType(Text/html; ISO-8859-8);
  .
} 

I  use the doGet method of a servlet to get parameters to retrieve from
Oracle. this is done through the URL, for example :
I send the parameters like this :
http://localhost:8080/myapp/myapp?name=yair
http://localhost:8080/myapp/myapp?name=yairfamily=fine family=fine
for name= yair, family = fine
 
There is no problem in getting and inserting English characters.
There is a problem when i try to get or to insert Hebrew characters.
i get  in DB , for both if i write yair in the url in Hebrew , or i
write yair in %E9%E9%E9%F8 which is the decimal representation 
 
For example , if i insert a string in Hebrew , it looks like this ? (
in SQL +)

 
this is how i get the requests from the url
Enumeration paramEnum = request.getParameterNames(); // get request
parameters from the url , in param/value pairs
String myParam = (String) paramEnum.nextElement(); //get parameter
String myValue = request.getParameter(myParam);  //get value
 
String myStatment = insert into mytable values('19', '+myValue+') insert
to table 19 , myvalue
ResultSet rs = stmt.executeQuery(myStatment);
 
does any one have a solution for that ?