Test encoding setter.