Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Fix HTTP post request wrong encoding

Salesforce Marketing Cloud Tips

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 FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

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

#cloud page #JavaScript #programming #ssjs
Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in solving problems, automating processes, and driving innovation in my clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified).

Additionally, I serve as a community advisor for Adobe Campaign, offering expert insights and guidance.

In addition to my professional pursuits, I also enjoy exploring various programming languages, CMSs, and frameworks, further enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Leave a comment

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

Similar posts that you may find useful

Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

How to add segments to proof subject

1 minute read

Issues arise when an email’s HTML contains personalization that includes multiple different variants, that is altering the appearance of the personalized email. Quality assurance (QA) of such proofs can become exceptionally challenging, particularly in cases where there are minor changes across variants or a substantial number of variants present. You can devide your variants by […]

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

Workflow stuck in pending start status

1 minute read

Have you ever found yourself waiting for a campaign workflow to start, only to experience delays or long waiting times? I’ve got a handy trick to share with you that can help you initiate the workflow immediately or significantly faster. I know that campaign managers schedule sometimes can be tight and waiting for pending start […]

Continue reading
Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

WOW! SQL queries are case insensitive

1 minute read

I recently discovered that when querying data views, case sensitivity in column names doesn’t make a difference; it consistently picks up the column when named correctly. Let’s explore where else column case sensitivity doesn’t play a significant role. First let’s create a data extension with some columns so we can test following in Query studio, […]

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

How to aggregate data in technical workflow

1 minute read

Every now and then, you may receive a request to aggregate data within an Adobe Campaign Classic workflow. However, if you group by something other than the targeting dimension, you may encounter an error such as “‘w0.iid’ must appear in the GROUP BY clause or be used as an aggregate function. The reason behind Adobe […]

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

Proof Email Template for Multiple Variants

1 minute read

Imagine having to proof all the possible variants of a delivery template, where there could be numerous end variations. How can we effectively proof such an email template? There is a simple yet powerful workaround for proofing all the variants, and here’s how to achieve it: Moreover, to differentiate between variations, you can include your […]

Continue reading