Parsing a standard STDF generated by Teradyne Ultraflex platform that contains ANSI characters not compatible with utf-8 causes UnicodeDecodeError to be thrown.
ANSI:
============= Test Suite – CONTINUITY =============
500000 2 CONTINUITY GPIO_00 17.t406 -900.0000 mV -434.4312 mV -30.0000 mV -1.0000 mA 0
500001 2 CONTINUITY GPIO_01 17.t412 -900.0000 mV -434.1914 mV -30.0000 mV -1.0000 mA 0
500002 2 CONTINUITY GPIO_02 17.r412 -900.0000 mV -435.3541 mV -30.0000 mV -1.0000 mA 0
UTF-8:
============= Test Suite � CONTINUITY =============
500000 2 CONTINUITY GPIO_00 17.t406 -900.0000 mV -434.4312 mV -30.0000 mV -1.0000 mA 0
500001 2 CONTINUITY GPIO_01 17.t412 -900.0000 mV -434.1914 mV -30.0000 mV -1.0000 mA 0
500002 2 CONTINUITY GPIO_02 17.r412 -900.0000 mV -435.3541 mV -30.0000 mV -1.0000 mA 0
Test code:
for REC in STDF.records_from_file(filename):
record = REC.to_dict()
Error:
Exception has occurred: UnicodeDecodeError 'utf-8' codec can't decode byte 0x96 in position 57: invalid start byte
Suggested Solution:
Change bytearray.decode() error handler from 'strict' to 'replace'
Parsing a standard STDF generated by Teradyne Ultraflex platform that contains ANSI characters not compatible with utf-8 causes UnicodeDecodeError to be thrown.
ANSI:
UTF-8:
Test code:
Error:
Exception has occurred: UnicodeDecodeError 'utf-8' codec can't decode byte 0x96 in position 57: invalid start byte
Suggested Solution:
Change bytearray.decode() error handler from 'strict' to 'replace'