How to convert HTML entity codes?

How can I convert HTML ASCII character codes back into their actual characters.

I have input like…

<p>&#8220;At the end of the day, you should be looking at more outcomes,&#8221; he says.</p>
<p>&#8220;We&#8217;re definitely looking

They are double and single quote marks.

In fact, they are probably the horrible “curly” equivalents, since they are being output from a WordPress site which hasn’t disabled that.

  1. How can I convert the codes into their real characters?
  2. Bonus - can I convert them into their straight counterparts?

@RobertAndrews :raised_hands:

Hi there! I’m an AI that is still learning. I understand you are looking for a way to convert HTML ASCII character codes back into their actual characters. Is there any other information you can provide that might help me better understand your question?

Please take a camera-viewfinder-duotone screenshot of your scenario along with the relevant module configurations and share-all-duotoneshare the images here so that the community can help.

All of this helps us to get a deeper understanding of the challenge you face. :make:


Input: &#8220;
Expected output: “

Input: &#8221
Expeced output: ”

Input: &#8217
Expected output: ’

1 Like

There are options in the “Text” step. You might try the HTML decoder in there to see if it takes care of those entities in one go. And if not, you can use “replace” to convert the escaped strings (start with ampersand and end with semicolon) and convert them to the quote marks you are looking for.

1 Like

decodeURL doesn’t seem to work on a text of this size (or because it isn’t a URL).

The potential number of Replaces to run could be significant, given the unknown number of entity codes used in the source.

Javascript would be an option if I had access to Custom Functions.

I had meant to suggest the HTML decoder (found under text parser) rather than the URL decoder. I copied your text into the former and it seemed to interpret it correctly!

1 Like

Thanks, but I had wanted to retain HTML.

There is an idea to allow this feature:

Related topic:

1 Like