Encode and decode HTML entities for safe display
HTML encoding converts special characters like <, >, &, and quotes into their HTML entity equivalents, preventing XSS attacks and ensuring proper display in web pages.