Skip to content

Doesn't handle non-ascii characters. #2

@d3v-null

Description

@d3v-null

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions