Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

648
Views
Dialogflow CX Messenger renderCustomText() and renderCustomCard() functions not rendering text correctly

I am using Dialogflow CX Messenger integration for one of my bots. I'm trying to use these functions. They work well until I use certain special characters such as accented characters. This happens commonly as one of the languages of my bot is spanish.

For example: "This is displayed correctly, until I use spanish characters such as ¿ Á é ñ . Emoji break it too: 🤔"

ends up being displayed as This is displayed correctly, until I use spanish characters such as ¿ à é ñ . Emoji break it too: 🤔

Example of what the output looks like in the messenger itself

This doesn't happen when the message itself comes from Dialogflow, it works fine when a response comes from there. Even emojis work. The issue only appears when I try to use these functions.

My code uses the embed code provided by the Dialogflow CX console, and I added a script that looks like this

window.addEventListener('dfMessengerLoaded', function (event) {
    const exampleText = "This is displayed correctly, until I use spanish characters such as ¿ Á é ñ . Emoji break it too: 🤔";
    dfMessenger = document.querySelector('df-messenger');
    dfMessenger.renderCustomText(exampleText);
});

I have tried using the renderCustomCard() function and ran into the same issue.

Any help is very appreciated! Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I ended up figuring it out, the problem wasn't with the function themselves.

It's just that I was lacking an UTF-8 reference: <meta charset="UTF-8" /> in my HTML. Once this was added in everything worked correctly.

What I found weird is how text sent from Dialogflow itself renders correctly without the need for this tag, which is why I misdiagnosed the problem.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!