SchrodingersGat / KiBoM

Configurable BoM generation tool for KiCad EDA (http://kicad.org/)
MIT License
352 stars 95 forks source link

Fix b'' issue with python3 csv files #59

Closed trentks closed 4 years ago

trentks commented 4 years ago

Hi @SchrodingersGat and @martinjaeger,

I've found this--this should solve #45.

Encoding was causing strings to be wrapped with b'', this appears to represent a binary encoding. Removing the encode removes this wrapping of b'' in python 3.

Tested with python 2.7.15, and 3.7.0, appears to work fine in both, but I don't know what purpose the encode was initially meant to fulfill. So my part names/descriptions/other fields might not have certain problematic characters, which the encode may have been used to sanitise?

SchrodingersGat commented 4 years ago

From memory the encode call was there because sometimes field names had weird characters e.g. μF and otherwise would not render properly.

Can you test this patch against fields with strange chars?

trentks commented 4 years ago

Hi @SchrodingersGat,

I see the issue, this latest commit should allow for UTF-8 encodings out in both python2 and python 3 (like μF) .

Should be ready to merge now.

Cheers.

SchrodingersGat commented 4 years ago

Ok I think I am happy with this approach. Thanks for your contribution :)