Christopher Schultz a écrit :
I'd agree that reading a URI is different, but not writing one. Where
are you writing your URI? Into the response, I'm guessing. In fact, I'm
guessing you're writing it into the response /body/, which ought to be
encoded using the response's declared Content-Type (in the HTTP header).
The encoding used for reading the URI from the request is irrelevant, here.
I disagree. Imagine that you want to write into the response /body/ a link to a google search, where the search parameter is the special char "&". Example : http://www.google.com/search?&q=%26 (so the correct way to write it in your response /body/ is: <a href="http://www.google.com/search?q=%26";>your search</a>)

If you just write the link without url encoding or html entities encoding, the link will be wrong : <a href="http://www.google.com/search?q=&";>your search</a>

If you write the link with html entities encoding, the link will be wrong : <a href="http://www.google.com/search?q=&amp;";>your search</a>

So you have to URLEncode your parameter, to write it into the response /body/: <a href="http://www.google.com/search?q=%26";>your search</a>

So, to generate and write into the response body links that include user inputs into the parameters, you have to URLEncode the parameters, it is an absolute necessity ! And that's the point: you can URLEncode them into different character encodings. And if they are links to your own tomcat server, you need to URLEncode the parameters in the same character encoding than the <Connector> URIEncoding.
What makes you think that the Connector has the right answer in the
first place?

Because it is the Connector that will read your URI ;) And so, when URLEncoding links to your server, the character encoding has to be the same.
You will see that the server does not interpret correctly the
parameters, because the <Connector> URIEncoding is still set to ISO-8859-1.

If you are setting the URIEncoding of the Connector to UTF-8 and it's
not interpreting it as UTF-8, then Tomcat has a bug
I wrote : "<Connector> URIEncoding is still set to ISO-8859-1" ;) ISO-8859-1 is the default value of the Connector URIEncoding.


Anyway, if we disagree, let's just get back to the point : how to know the Connector URIEncoding value, inside your application ? :)

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to