Forum Discussion

ariyan_79's avatar
ariyan_79
Occasional Visitor
3 years ago

Invalid UTF-8 start byte 0xa0

I am not able to fix the below issue in ReadyAPI - 

Invalid UTF-8 start byte 0xa0. Getting this error message in response. However same request payload is working in Postman.

 

{
"replyHeader" : {
"rqUID" : null,
"transactionRequestTs" : null,
"responseTs" : "2022-01-14T08:24:16.645811-05:00"
},
"modifiedRequest" : null,
"quoteNumber" : null,
"policyNumber" : null,
"premium" : null,
"errorMessages" : [
{
"code" : "E010",
"desc" : "Invalid UTF-8 start byte 0xa0"
}
],
"infoMessages" : null,
"legalDisclaimer" : null
}

  • Hi ariyan_79 .

    Never saw that before, but my guess is that your request contains some improperly encoded data and readyApi can't handle it. 

    Some suggestions, honestly don't know whether any of them would solve your issue, but you can give it a try...

     

    1° Can you visualize the request in the request "Outline" tab, or is there also an encoding issue? (assuming your request payload also is JSON)

    2° Perhaps there is some hidden character in your payload request that isn't visible in ReadyAPI (and probably get's properly escaped in Postman). Try perhaps to check here https://www.babelstone.co.uk/Unicode/whatisit.html what characters you actually send and look for any weird character that should normally not be there.

    3° There is a REST request properties option in readyAPI named "Encoding" which you can specifically set to UTF-8, perhaps that helps.

    4° I know I had also some UTF-8 encoding problems specifically in ReadyAPI that did not happen in PostMan. Try perhaps editing your ReadyAPI.vmoptions file (in the bin folder of your ReadyAPI installation folder) with notepad and add the following line : -Dfile.encoding=UTF8 (note: it should be followed by an empty line). Save and restart ReadyAPI.

     

    Hope it will help, good luck!

  • JoostDG's avatar
    JoostDG
    Frequent Contributor

    Hi ariyan_79 .

    Never saw that before, but my guess is that your request contains some improperly encoded data and readyApi can't handle it. 

    Some suggestions, honestly don't know whether any of them would solve your issue, but you can give it a try...

     

    1° Can you visualize the request in the request "Outline" tab, or is there also an encoding issue? (assuming your request payload also is JSON)

    2° Perhaps there is some hidden character in your payload request that isn't visible in ReadyAPI (and probably get's properly escaped in Postman). Try perhaps to check here https://www.babelstone.co.uk/Unicode/whatisit.html what characters you actually send and look for any weird character that should normally not be there.

    3° There is a REST request properties option in readyAPI named "Encoding" which you can specifically set to UTF-8, perhaps that helps.

    4° I know I had also some UTF-8 encoding problems specifically in ReadyAPI that did not happen in PostMan. Try perhaps editing your ReadyAPI.vmoptions file (in the bin folder of your ReadyAPI installation folder) with notepad and add the following line : -Dfile.encoding=UTF8 (note: it should be followed by an empty line). Save and restart ReadyAPI.

     

    Hope it will help, good luck!

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      THanks a lot for such a detailed reply JoostDG !

       

      Hi ariyan_79 , can you let the Community know if the suggestions were helpful? Thank you!