Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Fix HTTP post request wrong encoding

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 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 problem-solving, process automation, and driving innovation for clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified), as well as 1x Salesforce Associate certified.

Moreover, I serve as a community advisor for Adobe Campaign, providing expert insights and guidance.

Beyond my professional pursuits, I explore various programming languages, CMSs, and frameworks, 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

How to lock workflow in Adobe Campaign Classic
Adobe Campaign, Marketing Automation

Avoid Editing Conflicts: How to Lock Workflow

6 minutes read

Many times, I have encountered situations where multiple individuals were simultaneously editing the same workflow. In such cases, the version that is saved last ultimately takes precedence. To avoid this issue, a simple solution would be to implement a workflow lock, which can prevent such scenarios from arising. We want to achieve following business logic: […]

Continue reading
SFMC tips and tricks
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Error updating filter and new data extension

less than a minute read

If you’re using Email Studio in Salesforce Marketing Cloud and receive an ‘Error: updating filter’ message when creating a new Data Extension, it’s likely because the name you’ve chosen already exists. This error message can be misleading, but a simple solution is to rename the Data Extension with a more unique identifier. Make sure to […]

Continue reading
A visually engaging image representing 'SFMC Essentials: What You Need To Know' through digital and futuristic themes, tailored for Salesforce Marketing Cloud. The artwork includes symbols of marketing like graphs, analytics, and communication icons, combined with cloud computing motifs such as cloud shapes and digital network patterns. The color palette features dark blues and blacks, emphasizing the concept of advanced technology. The design is sleek, professional, and tailored to appeal to a tech-savvy audience, with a focus on clarity and visual appeal.
Marketing Automation, Salesforce Marketing Cloud

SFMC Essentials: What You Need To Know

3 minutes read

Let me show you the essentials I use in my day-to-day adventures with Salesforce Marketing Cloud. As we dive into this blog, I’ll share key insights and strategies that have been integral to my journey. I’ll provide you with practical advice for maximizing your experience with this marketing automation platform. Documentation Who wouldn’t guess this […]

Continue reading
Export data with no access to sftp
ACC Tips & Tricks, Adobe Campaign

Export data with no access to sftp

3 minutes read

There might be situations where you need to extract data in Adobe Campaign, but you don’t have access to SFTP or the application server itself to fetch the file. In such cases, I’ll guide you through what we can do. Original question has been posted on experience league where various options were mentioned from which […]

Continue reading
SFMC tips and tricks
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Redirect 500 internal server error inside try catch SSJS block

1 minute read

If you have Redirect function inside the try catch block, either as mixture of SSJS with AMPScript or only in SSJS, it will throw an 500 – Internal Server Error. Let’s take a look on few examples what can create an error that will take you some quality debugging time to figure it out. And […]

Continue reading