French characters in a JSP page

I have an HTML page with a form that has a text field that can accept text from the user. This text can be multilanguage and when French charcters are in the text field, when the user submits the HTML form, my JSP that retrieves the text from the text field is not encoding the characters properly.

For example, this line:

蒼onc?sur la sant? la s閏urit?et le milieu de travail

Into a String object in my JSP page as this:

?nonc sur la sant, la scurit et le milieu de travail

This is no doubt an encoding problem but I am not sure hot to fix it.

Anyone have any recommendations?

[618 byte] By [bryanoa] at [2007-11-27 8:27:47]
# 1
Set the encoding for the request, page and response correctly. Use UTF-8. Here's a link: http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/WebI18N5.html
hunter9000a at 2007-7-12 20:17:32 > top of Java-index,Java Essentials,Java Programming...
# 2

That indeed helped.

I had this page directive in the JSP page that contained the form:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

But I needed to add this line to the JSP page that the form was being posted to:

request.setCharacterEncoding( "UTF-8" );

bryanoa at 2007-7-12 20:17:32 > top of Java-index,Java Essentials,Java Programming...