velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bayarsaikhan VOLODYA <bayarsaik...@gmail.com>
Subject Re: encoding problem
Date Mon, 29 Aug 2005 08:49:09 GMT
i solved my prob :) it was really nothing to do with velocity. 
by using a simple UTF filter.

public class UTFFilter implements Filter {

public void destroy() {
}

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);
}

public void init(FilterConfig arg0) throws ServletException {
}
}

On 8/28/05, Daniel Dekany <ddekany@freemail.hu> wrote:
> 
> Friday, August 26, 2005, 3:38:26 PM, Bayarsaikhan VOLODYA wrote:
> 
> > hi,
> >
> > i have an encoding problem. in my velocity.properties
> >
> > input.encoding=UTF-8
> > output.encoding=UTF-8
> >
> > and i cannot get Turkish(ISO-8859-9) inputs from text fields. it becomes
> > something like this : ÜĞP,İŞ.Ö
> >
> > when i change my velocity.properties to
> >
> > input.encoding=ISO-8859-9
> > output.encoding=ISO-8859-9
> >
> > all turkish characters become : ???????
> >
> >
> > what can i do?
> 
> Look as when the Servlet container decodes the input with the wrong
> charset (so it has nothing to do with Velocity), probably with
> ISO-8859-1. To fix this, you have to call
> ServletRequest.setCharacterEncoding
> (theEncodingOfTheHTMLThatContainsTheForm).
> This call must be done before any parameter is read from the
> ServletRequest, or else it has no effect.
> 
> --
> Best regards,
> Daniel Dekany
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 


-- 
Bayarsaikhan VOLODYA
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message