Encode the id for urls