I don't know about other servlet containers. Perhaps those other containers are not complying to the specification.
There used to be a good resource "*Struts i18n* <http://www.anassina.com/struts/i18n/i18n.html> by Aaron Rustad." which was at http://www.anassina.com/struts/i18n/i18n.html
But it no longer appears to exist that showed some easy steps to make everything work nicely.
[EMAIL PROTECTED] wrote:
Hi, Jason.
Have you tried using setCharacterEncoding(...)? For me on Tomcat 4.1.30 it showed no result at all, and other solutions available on the web state that setCharacterEncoding should work but has problems on many servlet containers. Therefore all I found refers to creating new strings from getParameter()....
Hiran
----------------------------------------- Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99
-----Original Message-----
From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 6. Oktober 2004 22:01
To: Struts Users Mailing List
Subject: Re: Internationalizing a Struts project
You should only need to do the following:
request.setCharacterEncoding("UTF-8")
before the form is populated. I think you can do this by overriding the RequestProcessor. I use a filter to do this instead.
[EMAIL PROTECTED] wrote:
JSP/Servlet problem.Hi, Craig.
You hit the bull's eye. No I claim this not only to be a
The way you describe will cause the browser to encode allform data with UTF-8.
Unfortunately the servlet container (Tomcat in my case) doesnot know about this.
To obtain the correct parameter values, someone has to call(beware of
String(request.getParameter("...").getBytes("ISO-8859-1"), "UTF-8")Nullpointers and UnsupportedEncodingExceptions)
new
This conversion must be applied to all parameter values.Either it is done once in Struts, or each and every Action has to convert the values Struts provides, breaking this really nice architecture of FormBeans. In Cocoon I see this type of conversion can be turned on and off by configuration.
I recommend changing the RequestUtils' populate method(which I did for me), or enhancing the RequestProcessor to allow RequestUtils to be replaced by subclasses thereof so people like me can plug in their own RequestUtils. What do you think?
<[EMAIL PROTECTED]> wrote:Hiran
----------------------------------------- Hiran Chaudhuri SAG Systemhaus GmbH Elsenheimer Straße 11 80867 München Phone +49-89-54 74 21 34 Fax +49-89-54 74 21 99
-----Original Message----- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Dienstag, 5. Oktober 2004 23:47 To: Struts Users Mailing List Subject: Re: Internationalizing a Struts project
On Tue, 5 Oct 2004 16:31:14 +0200,
[EMAIL PROTECTED]
depending
references I find about this topic deal with using messagesHi there.
I'm working on i18n of a Struts based project. All
sterling oron the user's locale. Has anyone ever experienced problems with national special characters (such as currency symbols for
back to theeuro?
This issue is more related to the way JSP works than Struts, but here's a summary.Hiran
The most important consideration for national characters is the character encoding that will be used to send the response
explicitly, JSP pagesbrowser. Unless you ask for something different
which willare always sent back in ISO-8859-1 (basically 7-bit ASCII),
tags (suchcreate problems with characters outside the 7-bit range.
To ask for the content encoding to be set differently, you use the page directive at the top of your JSP pages, for example, to select
UTF-8:
<%@ page contentType="text/html;charset=UTF-8" %>
If all of your national characters are produced by custom
this should beas <bean:write> or <html:input> in the case of Struts),
depend onall you need. If you also want to use literal characters in the template text of your JSP page, you have to go one step further -- actually store the source code of your JSP page in an appropriate encoding, and tell the JSP compiler what that encoding is. The details of how you save pages in a particular encoding will
---------the text editor or IDE you are using, but the mechanism to tell JSP about it is standard. So, if you also use UTF-8 encoding for your source page, you'd say:
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" T%>
Craig McClanahan
------------------------------------------------------------
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]
-- Jason Lea
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jason Lea