Encode HTML special characters (<, &, ", ', >) as named or numeric entities, or decode them back to plain text. Auto-detects direction.