Encode special characters to HTML entities for safe embedding.
Decode HTML entities back to readable text.
Percent-encode text for safe use in URLs.