Encode text for use in URLs or decode percent-encoded strings. Supports both encodeURIComponent (encodes everything) and encodeURI (preserves URL structure).