Péter Sánta
Péter Sánta

Reputation: 31

JMeter variable Encoding is not correct

I'm using Jmeter 5.3 on Windows 10. I'm facing with the following problem: I set the HTTP request to content encoding: UTF-8. In the response I saw it as I wanted.

"name": "Győr, autóbusz-állomás",

I tried to extract the response with JSON Extractor, but my assertion is failed and in the debug sampler the extracted name look like:

origin.name=Gy�r, aut�busz-�llom�s

How could I extract the variable in UTF-8 to use it in my assertion?

Thank you in advice,

Upvotes: 2

Views: 4638

Answers (4)

Hristina
Hristina

Reputation: 11

Just made it for Norwegian.

  1. Go to jmeter.properties file which is in the bin folder
  2. Find --> 'sampleresult.default.encoding=UTF-8'
  3. Remove the # before this text. Should look like this: # The encoding to be used if none is provided (default ISO-8859-1) sampleresult.default.encoding=UTF-8
  4. Save and close the file
  5. Restart jmeter & enjoy

Upvotes: 1

Khoa Ha
Khoa Ha

Reputation: 1

Try to resolve with:

  • Go to jmeter.properties file
  • Add property: sampleresult.default.encoding=UTF-8
  • Restart jmeter & enjoy

Good luck!

Upvotes: 0

quadrix
quadrix

Reputation: 66

I had the same problem. It was resolved with setting in HTTP Request "UTF-8" value on field "Content encoding".

Without it in my request was "???" symbols.

enter image description here

Upvotes: 2

Dmitri T
Dmitri T

Reputation: 168157

I cannot reproduce your issue:

enter image description here

Double check file.encoding System property value using the Debug Sampler, you should have UTF-8

enter image description here

If you don't - try launching JMeter as:

jmeter -Dfile.encoding=UTF-8

if it helps - add file.encoding=UTF-8 line to system.properties file (lives in "bin" folder of your JMeter installation, JMeter restart will be required to pick the property up.

More information:

Upvotes: 0

Related Questions