I noticed than non-ASCII characters (e.g. ± with component tolerances) were getting destroyed when generating an .xml BOM. The fix was to specify the encoding when calling toprettyxml(), and then call .decode('utf-8') to get the bytes back into a Python string suitable to output.write().
Oh and sorry about my previous pull-request that used f-strings, I didn't realize Python 2 was supported. I then noticed that KiCAD for Windows is still bundled with Python 2 :-).
I noticed than non-ASCII characters (e.g.
±
with component tolerances) were getting destroyed when generating an.xml
BOM. The fix was to specify the encoding when callingtoprettyxml()
, and then call.decode('utf-8')
to get the bytes back into a Python string suitable tooutput.write()
.Oh and sorry about my previous pull-request that used
f-strings
, I didn't realize Python 2 was supported. I then noticed that KiCAD for Windows is still bundled with Python 2 :-).