utf-8 problem with NanonisFile
Created by: donpatrice
I have a sxm file, that causes some problems when reading it with NanonisFile:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 67: invalid start byte
I found that the relevant part differs from nanonispy by
try:
entry = line.strip().decode()
except UnicodeDecodeError:
warnings.warn('{} has non-uft-8 characters, replacing them.'.format(f.name))
entry = line.strip().decode('utf-8', errors='replace')
In particular these lines are missing in pycroscopy. Is there a reason for this? Adding these lines solves my problem.