url_encode binary and integer params correctly

* via @rpt