Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: URIEncoding

Frederic Bastian

2007-07-26

Replies:

Caldarale, Charles R a ?crit :
>> From: Frederic Bastian [mailto:Frederic.Bastian@(protected)]
>> Subject: Re: URIEncoding
>>
>> Is there a way to get the value of the param URIEncoding of the
>> Connector, so your code will work, whatever the char encoding of the
>> Connector is ?
>>  
>
> I'm confused. If the <Connector> already has the proper URIEncoding
> value, why do you think the application needs to reprocess the URI with
> the same encoding?
>  

The point is that I need to use the java.net.URLEncoder.encode() method,
e.g. java.net.URLEncoder.encode(myParam, "UTF-8").

Using a different character encoding than the Connector URIEncoding
leads to problems ; for instance, if the Connector URIEncoding is set to
"ISO-8859-1" (default value), and the URLEncoder.encode() method set to
"UTF-8" => problems (one obvious solution is to modify the URIEncoding)

I would like to use URLEncoder.encode() method with the character
encoding UTF-8 (W3C recommendations). So, I MUST modify the Connector
URIEncoding parameter, but I don't want to, to improve portability.

So I would like to manage this problem in the application itself rather
than in server.xml, for portability purposes. The only solution I see is
to find a way to get the value of the URIEncoding parameters.

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.