more robust url encoding