piloupy GOTTAPIL wrote:
What I've done is stupid. I don't use the possibilities of the UTF-8
encoding by setting the charSet to "ISO-8859-15".

It's been nearly 2 days that I'm on a detail according to my manager.
I'm obliged to put the UTF-8 aside...

To answer you :
- The JSP directive <%@ page contentType="text/html;
charset=ISO-8859-15" %> will replace the <meta> tag in the header to
specify the content type & charset.

I would recommend using both; the @page directive tells the JSP processor to output ISO-8859-15 (or whatever you specify), while the META tag tells the browser to interpret the page using that encoding. You need both to be in sync, obviously. That should take care of output data.

The browser will then, by convention, encode any request data it sends in the same encoding as the page you delivered, at which point you need to be sure to use the correct encoding to read the parameters. To do that, you need to call the request.setCharacterEncoding() method. The easiest way to make sure that happens before the request data is read is to use a Servlet Filter. If you don't set the request encoding, input data may/will appear 'corrupted'.

Most importantly, *be consistent*. You *must* specify the same character encoding everywhere so everything stays in sync. Finally, I'd suggest using UTF-8 from the get-go, so you don't run into limitations on what you can display or read down the line.

HTH,

L.

- I can't use a struts.properties since it's a functionnality for
struts2. I'm working with Struts 1.3.

Thank you anyway for your answers, guys.

piloupy


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

Reply via email to