[xiph-cvs] cvs commit: positron/positron audiofile.py

Stan Seibert volsung at xiph.org
Tue Jun 10 14:58:10 PDT 2003



volsung     03/06/10 17:58:10

  Modified:    positron audiofile.py
  Log:
  Burned in hell for incorrectly converting Unicode, but didn't learn my
  lesson.  Now we smash the Unicode into ASCII and replace the
  unrepresentable characters with question marks.

Revision  Changes    Path
1.4       +3 -3      positron/positron/audiofile.py

Index: audiofile.py
===================================================================
RCS file: /usr/local/cvsroot/positron/positron/audiofile.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- audiofile.py	9 Jun 2003 11:16:15 -0000	1.3
+++ audiofile.py	10 Jun 2003 21:58:10 -0000	1.4
@@ -92,11 +92,11 @@
                 if type(value) == ListType or type(value) == TupleType:
                     value = value[0]
 
-                # Convert from Unicode back to normal string since
-                # the Neuros can't do Unicode anyway.
+                # Convert from Unicode to ASCII since the Neuros can't
+                # do Unicode anyway.
                 #
                 # I will probably burn in i18n hell for this.
-                info[tag] = str(value)
+                info[tag] = value.encode('ascii','replace')
 
     except ogg.vorbis.VorbisError:
         return None

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list