Encode special characters to HTML entities or decode entities to characters. Prevent XSS and display code safely.