jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Encoding of variables on an HTTP Post gives strange results
Date Thu, 21 Apr 2005 23:32:23 GMT
Yes, it does default to UTF-8 in EncoderCache (encode) and HTTPArgument (decode)

This is most likely because of the following comment in the JavaDoc for 
java.net.URLEncoder.encode(String s, String enc)
...
Note: The World Wide Web Consortium Recommendation states that UTF-8
should be used. Not doing so may introduce incompatibilites.

S.
On 4/21/05, Sweet-Escott, John <john.sweetescott@gb.unisys.com> wrote:
> I have done some more investigation into this on my machine. The following java class:
> public class Default {
>         public static void main(String[] args) {
>                 System.out.println("Encoding: " + System.getProperty("file.encoding"));
>         System.out.println(java.net.URLEncoder.encode(args[0]));
>         }
> }
> 
> Yields:
> >java -Dfile.encoding=UTF-8 Default ÿ
> Encoding: UTF-8
> %C3%BF
> 
> >java Default ÿ
> Encoding: Cp1252
> %FF
> ... which would indicate that somewhere in JMeter the default encoding is being set up
for UTF-8
> John
> 
> -----Original Message-----
> From: Michael Stover [mailto:mstover1@apache.org]
> Sent: 21 April 2005 16:29
> To: jmeter-user@jakarta.apache.org
> Subject: Re: Encoding of variables on an HTTP Post gives strange results
> 
> It's possible this is a case where the UrlEncode.encode() method needs a
> locale passed to it to work correctly - which is a new method in jdk1.4
> only, whereas JMeter tries to be jdk1.3 compatible.
> 
> I'm not sure which locale you're in - are you using the default locale
> for your region or is your computer set up with a different locale
> setting?
> 
> -Mike
> 
> On Thu, 2005-04-21 at 16:11 +0100, sebb wrote:
> > Which version of JMeter? JVM? OS?
> >
> > Does the same behaviour occur with GET parameters?
> >
> > It might perhaps be a problem with the default platform encoding which
> > could lead Jmeter to think the input was different.
> > Just a thought.
> >
> > I may have time to investigate this tonight.
> >
> > S.
> > On 4/21/05, Sweet-Escott, John <john.sweetescott@gb.unisys.com> wrote:
> > > Hi
> > >
> > > I have a jmeter variable that contains the string Aÿ (that is a capital A
(ASCII 65) followed by y umlaut (ASCII 255)... in case this gets mangled by email).
> > >
> > > When I use this variable in the HTTP sampler as a POST variable with encoding
enabled it is encoded as A%C3%BF (that is A followed by A tilde (ASCII 195) followed by upside
down question mark (ASCII 191)) in the request. This does not seem right.
> > >
> > > If I do not encode, it is sent as y umlaut (which actually seems to work...).
However I do need the encoding when the variable contains the value A% (which is encoded correctly
as A%25.
> > >
> > > Any thoughts... could this be a problem with handling ASCII values > 127?
> > >
> > > Regards
> > > John
> > >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message