liamks / libpytunes

Python Itunes Library parser
https://github.com/liamks/pyitunes
MIT License
220 stars 88 forks source link

Issue with non english characters #55

Open bafonso opened 6 years ago

bafonso commented 6 years ago

Just got this using 2.7, conda environment w/ tensorflow. My library definitely has a lot of accents

---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-2-df9cbca52326> in <module>()
     19     if song and song.rating:
     20         if song.rating > 80:
---> 21             print("{n}, {r}".format(n=song.name, r=song.rating))

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 5: ordinal not in range(128)

I'm simply testing out the code for using pickle.

bafonso commented 6 years ago

how is song.name read from itunes xml? itunes has utf-8 encoding, is the file being parsed as utf-8?