Convert special characters in string to %HH code


I am trying to generate urls to access an API and I need to replace special characters with their equivalent %HH code that is readable by the httr::GET() function.

I would like to convert this string:ôtel%20des%20Postes,1000%20&apiKey=sVJ3-TbDbG1bbQciCjet_is3eybkZb0bvJjWxgHI1F0

to this string:,1000%20&apiKey=sVJ3-TbDbG1bbQciCjet_is3eybkZb0bvJjWxgHI1F0

as you can see the "ô" got converted to %C3%83%C2%B4 and this string works as an argument to the httr::GET() function.

Thank you,