You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by SanderW <sa...@performancearchitecten.nl> on 2011/01/26 13:40:28 UTC

Path seems to be encoded to unicode instead of utf-8

Hi,

I have a variable url that is populated by the CSV Data Set Config.
When I use the variable in the HTTP Request in the Path it looks like it's
encoded to unicode while I want it to be encoded to UTF-8.

%c3%a9 becomes é instead of é.

I'm using version 2.4.

Is there a way to fix this? I have checked the saveservice.properties but I
only see file_encoding=UTF-8

Kind Regards,
Sander
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357795.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Path seems to be encoded to unicode instead of utf-8

Posted by SanderW <sa...@performancearchitecten.nl>.
Hmm, strange. 

I'm running the same script on another Windows 2003 server with the same
JMeter version and I'm having no problems with my initial script at all.
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357854.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Path seems to be encoded to unicode instead of utf-8

Posted by Rajiv Nanduani <ra...@gmail.com>.
Hi,

Just google/try this functions in java script

escape() <http://www.w3schools.com/jsref/jsref_escape.asp>,encodeURI()<http://www.w3schools.com/jsref/jsref_encodeuri.asp>
,encodeURIComponent()<http://www.w3schools.com/jsref/jsref_encodeuricomponent.asp>.

lets see which will work for you.

But one question %c3%a9 is this in your csv file

On Wed, Jan 26, 2011 at 6:47 PM, SanderW
<sa...@performancearchitecten.nl>wrote:

>
> For my last remark: The '/' changing to %2f is no problem. The bad requests
> were caused by the file encoding I have put up at CSV data config.
>
> Rajiv, your solution does fix the ä (changes into %c3%bc), but it changes
> %c3%a9 to %25c3%25a9, resulting in the bad request
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357828.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
RAJIV KUMAR

<http://rajivkumarnandvani.wordpress.com/>
<http://learnqtphelp.blogspot.com/>

Re: Path seems to be encoded to unicode instead of utf-8

Posted by SanderW <sa...@performancearchitecten.nl>.
For my last remark: The '/' changing to %2f is no problem. The bad requests
were caused by the file encoding I have put up at CSV data config. 

Rajiv, your solution does fix the ä (changes into %c3%bc), but it changes
%c3%a9 to %25c3%25a9, resulting in the bad request
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357828.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Path seems to be encoded to unicode instead of utf-8

Posted by SanderW <sa...@performancearchitecten.nl>.
Hi Rajiv,

I tried that, but it changes the '/' in the url to %2f resulting in a bad
request

Sander
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357822.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Path seems to be encoded to unicode instead of utf-8

Posted by SanderW <sa...@performancearchitecten.nl>.
When I enter 'UTF-8' as file encoding in the CSV Data Set Config I see that
%c3%a9 is no longer changed to unicode, but ü is now no recognized at all 
-- 
View this message in context: http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357818.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Path seems to be encoded to unicode instead of utf-8

Posted by Rajiv Nanduani <ra...@gmail.com>.
Did you tried with javascript function may be it will work.
${__javaScript(encodeURIComponent('${abc}');)}

On Wed, Jan 26, 2011 at 6:10 PM, SanderW
<sa...@performancearchitecten.nl>wrote:

>
> Hi,
>
> I have a variable url that is populated by the CSV Data Set Config.
> When I use the variable in the HTTP Request in the Path it looks like it's
> encoded to unicode while I want it to be encoded to UTF-8.
>
> %c3%a9 becomes é instead of é.
>
> I'm using version 2.4.
>
> Is there a way to fix this? I have checked the saveservice.properties but I
> only see file_encoding=UTF-8
>
> Kind Regards,
> Sander
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Path-seems-to-be-encoded-to-unicode-instead-of-utf-8-tp3357795p3357795.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


-- 
RAJIV KUMAR

<http://rajivkumarnandvani.wordpress.com/>
<http://learnqtphelp.blogspot.com/>