replace urlencode() and custom encoding with rawurlencode()