-2

i want to encode a string using UTF 8 and pass the encoded value as part of payload in a post request.

rks
  • 1

1 Answers1

0

As per the Guide to Character Encoding in Java if encoding is not specified explicitly it falls back to the platform default encoding.

So the easiest would be just setting file.encoding Java system property to UTF-8, it can be done in system.properties file (lives in "bin" folder of your JMeter installation)

JMeter restart will be required to pick up the properly. More information: Apache JMeter Properties Customization Guide

Additionally you can specify the request encoding in the HTTP Request sampler (or HTTP Request Defaults)

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • still didn't work, is there any other way to encode the string to utf-8 using any preprocessor or function – rks Sep 26 '22 at 09:14