Encode special characters to HTML entities or decode HTML entities back to plain text. Supports numeric and named entities.