diff --git a/vxi11/vxi11.py b/vxi11/vxi11.py index 231582d..a6315b0 100644 --- a/vxi11/vxi11.py +++ b/vxi11/vxi11.py @@ -662,8 +662,8 @@ def write_raw(self, data): if self.term_char is not None: flags = OP_FLAG_TERMCHAR_SET - term_char = str(self.term_char).encode('utf-8')[0] - data += term_char + term_char = str(self.term_char).encode('utf-8') + data += struct.pack('B', ord(term_char)) flags = 0 @@ -709,7 +709,7 @@ def read_raw(self, num=-1): if self.term_char is not None: flags = OP_FLAG_TERMCHAR_SET - term_char = str(self.term_char).encode('utf-8')[0] + term_char = ord(str(self.term_char).encode('utf-8')) read_data = bytearray()