fix self.encoding data type