Copy the payload if its encoding needs to be changed