Hello Chris,

        1. If the filter does not influence the decoding of the GET  parameters 
why is it called on GET requests? 
        2. How about http : PUT, HEAD, etc?
        3. I did what this page says: 
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8
What if I want to build a fully UTF-8 application that will be posted on a web 
hosting provider where I have no access to server.xml (because this is a common 
file)?
        4. I didn't sniff the wire - I only had a look at the  URL I send with 
the javascript alert function.

        5. "Utf8encode" converts Unicode strings to strings of bytes in UTF-8 
encoding
(see here: http://www.webtoolkit.info/javascript-utf8.html). 
        6. "escape" (a standard script function) converts characters not 
acceptable for http (like slashes) 
to the %XX  notation. 
        7. Combined escape(Utf8encode("larevoluție"))="larevolu%C8%9Bie"
        8. POST is not really an acceptable solution because I don't know in 
advance what the keys of the request will be ("Name" in 
the example) neither how many they are & POST requires using a html <form>.
(what I do is build an  
URL in javascript/emacscript from a structured object returned by 
showModalDialog then alert(scriptBuiltUrl); 
window.location=scriptBuiltUrl;
). Thank you for your help.
Mircea





________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Wed, 21 April, 2010 18:43:21
Subject: Re: UTF-8 encoding in Tomcat 6.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mircea,

On 4/21/2010 6:56 AM, Mircea LUTIC wrote:
> The filter does get called on my GET request.

Of course.

> In my understanding, a filter is the reccomended method of handling
> UTF-8 for both GET & POST (as well as other methods like HEAD, PUT
> etc.).

The filter cannot influence the way that GET parameters are decoded. The
only way to change that is to set URIEncoding="UTF-8" on your
<Connector> in server.xml.

Your best bet is to transfer all non-US-ASCII data in request /bodies/
by using HTTP POST.

If HTTP POST is not acceptable, please let us know why and perhaps we
can suggest some alternatives.

This looks a bit weird to me:
>    
> window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))

What does the Utf8encode function do? What does the escape function do?

Have you tried snooping the HTTP conversation using a browser plug-in
and/or a line sniffer like Wireshark? What does the data doing over the
TCP/IP connection look like?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvPHRkACgkQ9CaO5/Lv0PDVkgCgu3dZM9mFNYXDjOBATjvJ5MMP
sN4AniN4aNLVnqsiEL7EzkxzVm4wp83F
=MpSC
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to