SOLVED

What is the HTML encode setting useful for?

Go to solution
Grégoire_Miche2
Level 10

What is the HTML encode setting useful for?

Dear all,

We have the possibility, in admin -> field Management, to activate the "HTML encode setting".pastedImage_0.png

Once enabled, all fields can have this setting activated or not, as here:

pastedImage_1.png

Does anyone knows the impact of this setting ?

Thx in advance,

-Greg

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: What is the HTML encode setting useful for?

If the token is meant to be output into raw HTML and is not otherwise validated, it's possible for the result to contain reserved character sequences that can only be solved by preemptively HTML-encoding.

For example, the string

     You &me; him &her;

will create parse errors because the &*; sequences are parsed as character references. Encoding the & to & removes the confusion. IIRC, Marketo outputs decimal references, but it's the same idea.

I've definitely seen problems that are solved by HTML-encoding, but it can't solve everything. And if you do choose to encode, you have to remember that parsing the tokens as JS strings won't work anymore. It's an either/or.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: What is the HTML encode setting useful for?

If the token is meant to be output into raw HTML and is not otherwise validated, it's possible for the result to contain reserved character sequences that can only be solved by preemptively HTML-encoding.

For example, the string

     You &me; him &her;

will create parse errors because the &*; sequences are parsed as character references. Encoding the & to & removes the confusion. IIRC, Marketo outputs decimal references, but it's the same idea.

I've definitely seen problems that are solved by HTML-encoding, but it can't solve everything. And if you do choose to encode, you have to remember that parsing the tokens as JS strings won't work anymore. It's an either/or.

Grégoire_Miche2
Level 10

Re: What is the HTML encode setting useful for?

Hi Sanford,

Thx !

-Greg