Encoding change


I have a problem with encoding.
My web app is all in UTF-8 as a result I run my tests with encoding set to UTF-8 in gatling.conf.
During my test, however, i need to get information from response from some external web page that is encoded only in ISO-8859-2.
When I try to do so I get following error: [ERROR] i.g.h.r.InputStreamResponseBody - Response body is not valid UTF-8 bytes.
When I change encoding to ISO-8859-2 in gatling.conf i get correct response in this step but I do not want do so as my whole app is in UTF-8.

Is there any way to change dynamically the response encoding? I tried ‘transformResponse’ but this will not work as reading response fails and there is nothing to transform.


For HTTP response body parsing, Gatling only uses the charset specified in the configuration as a default if it couldn’t extract one from the Content-Type response header.
Except if there’s a bug in Gatling and it doesn’t behaves as described, it looks like the charset is missing from your Content-Type header.
If so, you have to fix your applications.

Thanks for Your response.

It is true that Content-type of the response header does not contain charset.
Unfortunatelly (as I wrote previously) it is an external web page beyond my control. Now that I know this should fix the problem I will report it. Maybe someone will fix it one day.
It may be a bit confusing however as browsers automatically detect the encoding and Gatling does not.
anyway thanks for Your support