Safely convert special characters and non-ASCII/Unicode text (like emojis) into HTML entities or decode them back to raw text to prevent rendering issues and XSS vulnerabilities.
Only escapes characters with special meaning in HTML (&, <, >, ", ', /).