Hi, Andoni.
I'm not 100% sure how this all works, but I think there's a
default system encoding on the system where your Tomcat is running. This
encoding determines how the form request parameters come across. I think
when I ran into a similar problem a while back I got around it by doing
something like this:
String param = request.getParameter("param");
byte[] paramBytes = param.getBytes("UTF-8");
String paramToDatabase = new String( paramBytes, "UTF-8" );
Then, you can send paramToDatabase to the database. See if
something like that works for you. I've also seen discussion on this list
about using Filters to intercept the request and handle this kind of
thing, but I've never dealt with that.
HTH,
-Jeff
"Andoni" <[EMAIL PROTECTED]>
02/17/03 01:56 PM
Please respond to "Tomcat Users List"
To: "Tomcat Users List" <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
cc:
Subject: Re: UTF-8 Sending Euro symbol to Servlet in Form data.
Actually the prepared statements couldn't help as I can get the Euro
symbol
into the database fine by hard-coding it into my statement. It is only
getting the information **from the form to the servlet** that is having a
problem.
Andoni.
----- Original Message -----
From: "THG" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, February 17, 2003 7:42 PM
Subject: Re: UTF-8 Sending to Database.
> It could be, that the form data is double encoded or
> the jdbc driver automatically encoding the data on the
> fly. do u use prepared statements (setString())?
>
> what is the encoding of your dbms?
>
> On Mon, 17 Feb 2003 19:22:55
> Andoni wrote:
> >Hello,
> >
> >I am trying to send a Euro symbol ( ? ) to my database but it keeps
being
> >corrupted on the way to the servlet from the form on my page.
> >
> >When I replace the SQL string in my servlet with one which has a Euro
symbol
> >hard-coded it works fine and displays in my .jsp fine as the Euro
symbol
but
> >when I submit a form from my JSP with a Euro symbol it gets corrupted
into
> >nonsense on the way to the servlet.
> >
> >Can anyone please help??
> >
> >Thanks,
> >
> >Andoni.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> _____________________________________________________________
> Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
> http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]