Forum Discussion

Gordon_McNair's avatar
Gordon_McNair
Contributor
14 years ago

Problem with UTF-8 encoding in requests

This is the problem our team is having.

"I have a request that is supposed to be UTF-8 encoded when it is sent. We are testing with the following ‘¥£€¢₡‘ it is expected that this would be ‘\uC2A5\uC2A3\uE282\uACC2\uA2E2\u82A1’ but we get ‘[0xa5][0xa3][0x80][0xa2]?[0xa0]’ after some investigation this looks like either Window ANSI 1252 or ISO Latin-1 (iso-8859-1) but not utf-8. I’m not sure how to fix this as there does not appear to be any way to change the encoding that is being used. In the NVP instance i’m pre-encoding the string to be application/x-www-form-urlencoded; charset=UTF-8 using groovy but i’m not able to do this for the application/json; charset=UTF-8 at the moment."

The log of the issue is the following:
<log was removed>

We are seeing this behaviour when the tests ate running from a Windows XP machine.

Can you please advise if there is a solution or if this is a bug.

Thanks,
Gordon.

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Gordon,

    there is a "encoding" setting for the request in the bottom left table of properties (when the request is selected), could you try setting that to UTF-8 to see if it helps?

    regards!

    /ole
    eviware.com
  • This does work.

    However I was expecting that because the representation was defined in the WADL as 'application/json; charset=UTF-8' that it would use this by default. Setting the encoding there results in the following request:
    <request was removed>


    The charset gets listed twice. which is messy.

    Thanks for you help this was blocking a bunch of testing.

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    thanks, this is obviously a bug.. we'll check it out!

    regards,

    /Ole
    eviware.com