This is percent encoding encode/decode functions for C++