allow subclass to override attribute encoding