URL encode in Erlang

AFAIK there’s no URL encoder in the standard libraries exclude edoc_lib:escape_uri. Think I ‘borrowed’ the following code from YAWS or maybe one of the other