Is it possible that HTTP requires that the path and query string be in
ASCII rather than UTF-8, since there is no way to tell a server the
charset until after that first line is parsed?  I can't remember the
spec, offhand, but there are stranger things than that in there, so it
could well be true.  In genereal, it might not be a bad idea to use
ascii chars for parameter names, since they aren't really user
visible, anyway.  At least, a user doesn't need to manually interact
with them.

Another possibility may be that the default charset for the server
process isn't UTF-8.  It could therefore be using the default charset
when parsing the first line (or maybe even all the headers), and only
then switches to the specified charset.  What does
Charset.defaultCharset return when executed from within your webapp?
If it isn't UTF-8, try forcing the default charset to UTF-8 with the
following system property specified on the command-line or environment
when you start up your servlet container:

file.encoding=UTF-8

With tomcat, just set an environment variable called JAVA_OPTS to include:

-Dfile.encoding=UTF-8

your tomcat startup script should pickk that up and pass it to the
jvm.  You cannot change the default charset after starting the jvm.

--sam


On 12/5/06, Pedro José Ayala <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  I'm new to the list, and for my fist post I have an issue about
> autocompleter.
>
>  I have an UTF-8 application using tapestry 4.0.2 and tacos-4.0.1. In this
> application all the tacos staff is working with UTF-8 except autocompleter,
> which return strange not converted characters.
>
>  I've been taking a look and I found something interesting. Autocompleter
> send a GET request to the web server (I'm using Tomcat 5.5.20). The first
> thing tacos does is:
>  request.setCharacterEncoding("utf-8");
>
>  and after that it is supposed all the parameters should be decoded using
> this encoding, but it is not (at least for me).
>
>  when I try to get a parameter from the request:
>
>  request.getParameter("paisOrigen");
>
>  It gets me to tomcat's
> org.apache.catalina.connector.Request
>
>  public String getParameter(String name) {
>
>          if (!parametersParsed)
>              parseParameters();
>
>          return coyoteRequest.getParameters().getParameter(name);
>
>      }
>
>  It has never been parsed before so, it gets to the parse staff, which
> should decode the parameters.
>  protected void parseParameters() {
>  ....
>  if (!getMethod().equalsIgnoreCase("POST"))
>              return;
>  ...
>  DECODE STAFF
>  ....
>  }
>
>  So only if the submit method is POST, in my case for autocompleter is GET,
> it is decoded.
>
>  I'm not sure why autocompleter use GET instead of POST in my
> application.... do you have any clue? is this normal?
>
>  Thanks
>
>  Pedro Ayala
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Tacos-devel mailing list
> Tacos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tacos-devel
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to