velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai Yoshida <shinobu.ka...@gmail.com>
Subject Re: problem with latin2
Date Tue, 18 Jan 2005 14:25:31 GMT
Hi Katarzyna,

> I'm writing WEB application where I have to use polish fonts. I have set
> up input and output encodings to iso-8859-2 in velocity.properties, also
> compile application with option  -encoding latin2, templates are also
> set to iso-8859-2. I also use Postgres (database with option -E latin2).
> When I read data from database (which contains polish letters) and show
> it in navigator everything is ok.
> The problem is when I try to save data from form. After posting it I get
> "?" instead of every polish letter when validation fails, and when
> validation is ok every polish letter is gone (they are cut).
> To specify more I use Struts with Velocity.

The only problem is when you get input from the browser, is that
correct?  ie. Showing Polish statically or from your database with
your template is fine?

If so, you should check the encoding of your request.  Does the Polish
characters show when you do request.getParameter("so-and-so")?  If
not, you need to set the encoding of your request to latin-2.
   http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#setCharacterEncoding(java.lang.String)

Using Filter works for me.  :)
   http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/Filter.html

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <shinobu.kawai@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message