krateng / maloja

Self-hosted music scrobble database to create personal listening statistics and charts
https://maloja.krateng.ch
GNU General Public License v3.0
1.18k stars 69 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 666: invalid continuation byte #343

Closed mitteneer closed 7 months ago

mitteneer commented 8 months ago

I have some scrobbles with artist names containing an Ó character (ASCII byte 0xd3), and when I try to run maloja import lastfm.csv it errors out complaining about that character in the scrobble. In my limited research, it looks like this can be fixed by changing this line:

to the following: with open(filepath,'rb') as filed:

I would test and make a PR (and would love to contribute to this project in the future) but my experience with that is a bit limited/old.

edit: idk what I'm talking about lol. I managed to cobble together a testing environment and this doesn't work. It's been a while since I've done any coding

mitteneer commented 8 months ago

I checked previous issues (specifically #13) and this seems to be different - my locale seems to be correct:

>>> import locale
>>> locale.getpreferredencoding()
'UTF-8'
>>>

so I guess I'm not certain where to go with this?