Encode special characters to HTML entities and decode them back
Why encode? HTML entities prevent XSS attacks and ensure proper rendering of special characters.
Common entities: < = < | & = & | " = "
Numeric entities: < = < | < = <