🔥 500+ people already subscribed. Why not you? Get our newsletter with handy code snippets, tips, and marketing automation insights.

background shape
background shape

Fix HTTP post request wrong encoding

Recently, while working with the double opt-in process that employs an API to trigger transactional messages, I encountered an issue where Latin characters, characters with accent, were not captured correctly in the triggered send data extension.

I have found that the SFMC HTTPPost uses, by default, WindowsCodePage 1252 encoding, which can cause issues with accented characters such as ž, ň, or ä.

To resolve this issue, we need to set our own content type header in our HTTP.post request. However, it’s essential not to include it as an additional header, as doing so will result in a 500 internal server error. Instead, add the encoding to the second argument.

var contentType = "application/json; charset=utf-8",
HTTP.Post(url, contentType, Stringify(payload), [], []);

This way all the form submitted and pushed to transactional API will have correct encoding in the data extension.

Oh hi there 👋
I have a SSJS skill for you.

Sign up now to get an SSJS skill that can be used with your AI companion

We don’t spam! Read our privacy policy for more info.

Share With Others

The Author
Marcel Szimonisz

Marcel Szimonisz

MarTech consultant

I specialize in solving problems, automating processes, and driving innovation through major marketing automation platforms—particularly Salesforce Marketing Cloud and Adobe Campaign.

Your email address will not be published. Required fields are marked *

Similar posts