Encoding change

278 views
Skip to first unread message

Konrad Laskoski

unread,
Dec 6, 2016, 4:16:18 AM12/6/16
to Gatling User Group
Hi,

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.

regards,
Konrad

Stéphane LANDELLE

unread,
Dec 7, 2016, 4:44:37 AM12/7/16
to gat...@googlegroups.com
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.

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Konrad Laskoski

unread,
Dec 7, 2016, 5:28:53 AM12/7/16
to Gatling User Group
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

regards,
Konrad
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages