Add Encoding function for Version