Commits

Anonymous committed ed84de8

fix unicode

Comments (0)

Files changed (1)

friendpaste/snippets/code.py

                     if t not in tags_seen:
                         raise MetadataException("Missing tag '%s' in snippet metadata" % (t))
                 self.code = io_obj.read()
+                if not isinstance(self.code, unicode):
+                    self.code = self.code.decode('utf-8', 'strict')
                 self._highlight()
                 end_reached = True
             elif METADATA_COMMENT_RE.match(line):