We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 533d8a2 + a89828b commit 0393ba9Copy full SHA for 0393ba9
1 file changed
openxc/sources/usb.py
@@ -85,8 +85,8 @@ def _read(self, endpoint_address, timeout=None,
85
read_size=DEFAULT_READ_REQUEST_SIZE):
86
timeout = timeout or self.DEFAULT_READ_TIMEOUT
87
try:
88
- return str(self.device.read(0x80 + endpoint_address,
89
- read_size, self.DEFAULT_INTERFACE_NUMBER, timeout), 'ISO-8859-1')
+ raw_binary = self.device.read(0x80 + endpoint_address,read_size, self.DEFAULT_INTERFACE_NUMBER, timeout)
+ return str(raw_binary, 'utf-8', 'ignore') # Formerly - Causes byte tranlation str(temp, 'ISO-8859-1')
90
except (usb.core.USBError, AttributeError) as e:
91
if e.backend_error_code in [self.LIBUSB0_TIMEOUT_CODE, self.LIBUSB1_TIMEOUT_CODE, self.OPENUSB_TIMEOUT_CODE]:
92
# Timeout, it may just not be sending
0 commit comments