]> diplodocus.org Git - flac-archive/blobdiff - fa-rip
Use flac_archive.tags.Tags, greatly simplifying things. Put PART tag
[flac-archive] / fa-rip
diff --git a/fa-rip b/fa-rip
index fb2a18567677ae7e68373a3f8171f9fd7f8fce0e..4b7f76ddff63ff3cb02cbac8ca679c9a2485ae64 100755 (executable)
--- a/fa-rip
+++ b/fa-rip
@@ -1,6 +1,6 @@
 #! /usr/bin/env python2.4
 
-'''
+"""
 =head1 NAME
 
 B<fa-rip> - rip a CD for B<fa-flacd>
@@ -65,7 +65,7 @@ it under the same terms as Perl itself.
 
 =cut
 
-''' #' # python-mode is sucks
+"""
 
 import os, re, sys, tempfile, traceback
 from optparse import OptionParser
@@ -113,10 +113,10 @@ def tags_file(fn, trackcount, various, artist=None, album=None,
     fp = c(file, fn, 'w')
     c(fp.write, 'ARTIST=')
     if artist != None:
-        c(fp.write, artist)
+        c(fp.write, artist.encode('utf-8'))
     c(fp.write, '\nALBUM=')
     if album != None:
-        c(fp.write, album)
+        c(fp.write, album.encode('utf-8'))
     c(fp.write, '\n')
 
     have_date = False
@@ -135,8 +135,9 @@ def tags_file(fn, trackcount, various, artist=None, album=None,
         except IndexError:
             title = ''
             artist = ''
-        various and c(fp.write, 'ARTIST[%d]=%s\n' % (i, artist))
-        c(fp.write, 'TITLE[%d]=%s\n' % (i, title))
+        various and c(fp.write, 'ARTIST[%d]=%s\n' % (i,
+                                                     artist.encode('utf-8')))
+        c(fp.write, 'TITLE[%d]=%s\n' % (i, title.encode('utf-8')))
 
     c(fp.close)