We use UTF-8 encoding for request and response - at least as long as we can control the encoding. But Display Tag seems not to use the correct encoding.

Perhaps some more comments to our application:
We created a small Address search in one JSP
 1. HTML Form  (including field 'City')
 2. JSTL SQL Query
   (select ... from address a where ...
      and a.City like '%<c:out value="${param.City}"/>%')
 3. Diplay Tag which displays the result

Submitting the HTML Form works perfectly with UTF-8 encoding. As the result searching for a address with city = 'M�nchen' (german Umlaut!) is possible.

Whereas using the Display Tag generated links doesn't work due to the not UTF-8 encoded 'M�nchen' String. The result is a city String which is not correct anymore. So the HTML Form displays rubbish and the ResultSet of the query is empty.

How to solve?

Thank you,
Norbert

Andrew Close wrote:

i believe a similar question was just asked on the Struts-User mailing
list.  here was the answer given:

<snip>
You need to use native2ascii (program comes with java sdk and is also an
ant method) to convert the UTF-8 (or other formats) into the java
property file format which use \uXXXX

Main point is you need to request.setEncoding("UTF-8") on every request
(well, ones that have form values being submitted).  Otherwise they will
be treated as normal ascii and be corrupted.  Also pages need the
response encoding or page encoding set to UTF-8 too.

more info:
http://www.javaworld.com/javaworld/jw-05-2004/jw-0524-i18n.html

</snip>

hth
andy
...




-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to