This library provides URL encoding and decoding for Arduino, tested on Mega 2560 and ESP32. I'm sure its possible to do this more efficiently (without String), but I made this for another project and I have added it here because modularity is good.
Download this repo as a zip, unzip it and then place in Arduino/libraries
. Open/restart the Arduino IDE and an example should appear.