415
Views
2
Comments
Rest API weird characters
Question

I'm consuming a rest api. The response when tested, is great. Exactly what we are expecting. However, when we actually use it, all of the apostrophes are weird characters. I'm assuming this is some sort of encoding issue, but I'm such a newbie, that i have no idea where to go from here. Please see video which details the problem. I'm also going to upload OML file so you can see what i'm talking about.


EncodingIssue.oml
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Preston,

As you already assumed it has to do with encoding. Not sure why during test it looks good and when actually using not. But the fix is rather simple.

I added an OnAfterResponse action, and fixed the returned response request by converting the binary version of the response explicitly using the BinaryDataToText action with encode set to 'utf-8'.

See attached updated oml.

Regards,

Daniel

EncodingIssue.oml
2021-04-09 11-42-43
assif_tiger
 
MVP

Your REST API responds with Content-Type: application/js, While it should respond with

 "content-type:application/json;charset=UTF-8"


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.