diff --git a/openxc/sources/usb.py b/openxc/sources/usb.py index ca4754b1..aed7aac4 100644 --- a/openxc/sources/usb.py +++ b/openxc/sources/usb.py @@ -85,8 +85,8 @@ def _read(self, endpoint_address, timeout=None, read_size=DEFAULT_READ_REQUEST_SIZE): timeout = timeout or self.DEFAULT_READ_TIMEOUT try: - return str(self.device.read(0x80 + endpoint_address, - 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') except (usb.core.USBError, AttributeError) as e: if e.backend_error_code in [self.LIBUSB0_TIMEOUT_CODE, self.LIBUSB1_TIMEOUT_CODE, self.OPENUSB_TIMEOUT_CODE]: # Timeout, it may just not be sending