Skip to content

Commit

Permalink
chg: More forgiving of bad Unicode in text frames (fixes #105)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicfit committed Nov 18, 2017
1 parent 70706ff commit ed215f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/eyed3/id3/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,12 @@ def parse(self, data, frame_header):
super(TextFrame, self).parse(data, frame_header)

self.encoding = self.data[0:1]
self.text = decodeUnicode(self.data[1:], self.encoding)
try:
self.text = decodeUnicode(self.data[1:], self.encoding)
except UnicodeDecodeError as err:
log.warning("Error decoding text frame {fid}: {err}"
.format(fid=self.id, err=err))
self.test = u""
log.debug("TextFrame text: %s" % self.text)

def render(self):
Expand Down

0 comments on commit ed215f3

Please sign in to comment.