Re: Json Encode Issue

Anonymous
Not applicable

Json Encode Issue

When setting the request Token Encoding of a webhook to JSON, the special characters such as (à or é) are being converted to their corresponding javascript form instead of remaining as they originally are.

I tried switching the encoding to None however this proved to be problematic as a JSON string is being sent as a request and it ruins the structure of the string (booleans to be exact).

Is there a way the encoding could be configured or a setting for the field or webhook could be changed that would not have the characters such as (à or é) effected?

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Json Encode Issue

I don't think you mean "JavaScript form" but rather "HTML named entity." (Though without an example it's not clear.)

I'd guess you have HTML Encode Tokens enabled in Field Management for that field, yes?

Please provide an exact example so I can help further.

Anonymous
Not applicable

Re: Json Encode Issue

Hi Sanford,

The example is as follows.

Within the json object we are sending we have a field called "firstname".

This first name sometimes includes letters such as è and à.

Now within marketo's interface there are no issues with these letters.

But once they are sent in the webhook. I check the data that was sent in the activity log of the object in marketo and instead of sending è and à, it sends \u00e8 and \u00e0 respectively

Which technically speaking is the javascript format of those characters

Switching to the other Form/URL encoding does not suffice as it converts these characters to another format as well.

Removing the encoding altogether does not work either as it ruins the sent booleans (instead of sending true or false it sends 1 or nothing)

Thanks,

Dory

SanfordWhiteman
Level 10 - Community Moderator

Re: Json Encode Issue

OK, so you are talking about JavaScript (and JSON) Unicode escape sequences.

I don't understand why this is a problem. Any working JSON library understands these are valid JSON characters, as mandated by the JSON spec. Perhaps they're unnecessary, but they're not broken. (And Marketo doesn't need to treat these Latin-1 characters in any special way -- though they do in the HTML context as well so there's an obvious link on the back end.)