Serialize encoding