DanChianucci / Eagle2Kicad

Converts an Eagle 6.0+ .brd into a kicad .brd
MIT License
92 stars 30 forks source link

Conversion failure - Python encoding issue #20

Open nahidalam opened 10 years ago

nahidalam commented 10 years ago

Using Python3.3

I see below error while converting texas.lbr to KiCAD format

Conversion Failed Traceback (most recent call last): File "Start.py", line 141, in convertLib lib.writeLibrary(modFile,symFile) File "C:\Python33\Eagle2Kicad/Library\Library.py", line 67, in writeLibrary self.writeSymFile(symFile) File "C:\Python33\Eagle2Kicad/Library\Library.py", line 88, in writeSymFile devicepart.write(symFile) File "C:\Python33\Eagle2Kicad/Common\Symbol.py", line 51, in write symbol.write(symFile) File "C:\Python33\Eagle2Kicad/Common\Symbol.py", line 114, in write symFile.write(pin.symRep()) File "C:\Python33\Lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\x96' in position 4: character maps to

DanChianucci commented 10 years ago

I am unable to reproduce this without the .lbr file. I tried converting the texas.lbr which was supplied with eagle, but it worked fine.

It looks as though your copy of texas.lbr is just not encoded as UTF-8. You can try to re-encode the .lbr as UTF-8,

--or--

In the Start.py file there is a line that says

parser = XMLParser(encoding="UTF-8")

Try changing that to

parser = XMLParser()