Maybe I'm just being lazy though.
Decode is what I meant to say, sorry.
Decode is what I meant to say, sorry.
The very definition of decoding and encoding is to manipulate the string to the format needed.
The very definition of decoding and encoding is to manipulate the string to the format needed.
There probably is, but IMHO there shouldn't. An encode should encode and nothing else, no sanitizing, no stripping, no fiddling with encoding.
One tool for one thing. Simple input, simple output. Combine them as alias or function or method or whatever your language likes it to be called.