Here's the list of lower ASCII characters you'll normally encounter in English content, and in HTML markup.
!"#$%&'()*+,-./
0123456789
:;<=>?@
ABCDEFGHIJKLMNOPQRSTUVWXYZ
[\]^_`
abcdefghijklmnopqrstuvwxyz
{|}~
I've broken these into groups for convenience.
Why & How Text Gets Encoded
Encoding and escaping is often about maintaining the ability to distinguish structure from content;
- URL path structures, like protocol, domain, path, and query, from the contents within each of those.
- HTML DOM element hierarchies, from the content within them.
- Javascript code, from the content stored in arrays, JSON, and literal strings.
Because each of these grammars are different, the encoding rules are different too. This will be very important soon.
Because many of these characters are also relied upon for HTML markup, they must be encoded to prevent conflict.
For example, HTML uses angle brackets < and > to identify tags. Therefore if you have text content containing an angle bracket, it must be encoded. In HTML a < is encoded as an HTML entity <
HTML Encoding
In most HTML encoders, these are the common text characters that are HTML-encoded, while others are left untouched.
- Less-than ( < ) becomes <
- Greater-than ( > ) becomes >
- Double-quote ( " ) becomes "
- Dollar-Sign aka Sect ( $ ) becomes §
- Ampersand ( & ) becomes &
- Single-quote ( ' ) becomes '
- Minus aka Hyphen ( - ) becomes -
JSON Encoding
JSON is different, so JSON encoding is different.
- Double-quote ( " ) becomes \"
- Backslash ( \ ) becomes \\
See a table of comparisons.
Webflow & Character Encoding
When you use an HTML Embed or Custom Code, Webflow gives you the ability to insert CMS field content into your page.
If you're asking... ok, but how is that encoded? you're asking the right question.
It's HTML encoded. Always.
Where this causes problems
One of the most common areas where people experience issues with this is in trying to create JSON+LD content in the site, for Google SEO.
But that encoding problem can bite you. If your string has a double-quote in it, the HTML encoding won't encode it at all, and your JSON will get something like...
{
"title": "Bob's "bait" shoppe"
}
Which Google will choke fiercely on.
FAQs
Answers to frequently asked questions.