I got STDF files with strings containing ANSI char like "70°C". It's not an issue as it's still only one-byte char.
But as it's over ord(127), it fails when using ASCII decoding.
Then I add 2 try-except cascade, to decode with ANSI if ASCII fail, and even replace char if ANSI fail.
My opinion is its better to be able to read a file with typo than not at all.
Also for DRY purposes, I don't want to duplicate above change, then I want to reuse Cn decoding for C1 token.
Hi,
I got STDF files with strings containing ANSI char like "70°C". It's not an issue as it's still only one-byte char. But as it's over ord(127), it fails when using ASCII decoding.
Then I add 2 try-except cascade, to decode with ANSI if ASCII fail, and even replace char if ANSI fail. My opinion is its better to be able to read a file with typo than not at all.
Also for DRY purposes, I don't want to duplicate above change, then I want to reuse Cn decoding for C1 token.
Hope that's clear.
PS : imports have been automatically refactored.