correctly URL-escape contents