From d6205bf8dd298a5b629304e5853595510519432c Mon Sep 17 00:00:00 2001 From: coburn Date: Mon, 26 Feb 2018 21:54:18 -0800 Subject: [PATCH] fix termchar in both python2.7 and 3.6 --- vxi11/vxi11.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()