option to encode type