Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't handle non-ascii characters. #2

Open
d3v-null opened this issue Apr 19, 2020 · 1 comment
Open

Doesn't handle non-ascii characters. #2

d3v-null opened this issue Apr 19, 2020 · 1 comment

Comments

@d3v-null
Copy link
Contributor

When it tries to print a song where the artist name is RÜFÜS / u'R\xdcF\xdcS' , it gives this error

Traceback (most recent call last):
  File "/Users/derwent/.pyenv/versions/2.7.15/lib/python2.7/pdb.py", line 1314, in main
    pdb._runscript(mainpyfile)
  File "/Users/derwent/.pyenv/versions/2.7.15/lib/python2.7/pdb.py", line 1233, in _runscript
    self.run(statement)
  File "/Users/derwent/.pyenv/versions/2.7.15/lib/python2.7/bdb.py", line 400, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "shazam-tags.py", line 3, in <module>
    import os
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 1: ordinal not in range(128)
Uncaught exception. Entering post mortem debugging

I think sqlite is expecting all data to be encoded in utf-8, but since this string is encoded in latin-1 , it needs to be re-encoded

d3v-null pushed a commit to d3v-null/shazam-tags that referenced this issue Apr 19, 2020
sn3p added a commit that referenced this issue Dec 23, 2020
@sn3p
Copy link
Owner

sn3p commented Dec 23, 2020

Thanks @derwentx, sorry for the late reply.
Should this be fixed using your PR which I just merged? I didn't have the time to properly test it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants