Author: tack
Date: Wed Apr 26 15:39:05 2006
New Revision: 1511

Modified:
   trunk/metadata/src/audio/eyed3info.py

Log:
Grip unicode bug workaround; dischi, please test this one of your mp3s that
you have encoded with grip but have corrected the encoding flag.


Modified: trunk/metadata/src/audio/eyed3info.py
==============================================================================
--- trunk/metadata/src/audio/eyed3info.py       (original)
+++ trunk/metadata/src/audio/eyed3info.py       Wed Apr 26 15:39:05 2006
@@ -143,6 +143,21 @@
       try:
          if id3 and id3.tag:
             log.debug(id3.tag.frames)
+
+            # Grip unicode bug workaround: Grip stores text data as UTF-8
+            # and flags it as latin-1.  This workaround tries to decode
+            # these strings as utf-8 instead.
+            # 
http://sourceforge.net/tracker/index.php?func=detail&aid=1196919&group_id=3714&atid=103714
+            for frame in id3.tag.frames['COMM']:
+                if "created by grip" not in frame.comment.lower():
+                    continue
+                for frame in id3.tag.frames:
+                    if hasattr(frame, "text") and isinstance(frame.text, 
unicode):
+                        try:
+                            frame.text = 
frame.text.encode('latin-1').decode('utf-8')
+                        except:
+                            pass
+
             for k, var in MP3_INFO_TABLE.items():
                if id3.tag.frames[k]:
                   setattr(self, var, id3.tag.frames[k][0].text)


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to