I'm using the ID3 tag of an mp3 file to query musicbrainz to get their
sort-name for the artist.  A simple example is "The Beatles" ->
MusicBrainz -> "Beatles, The".  I then want to rename the mp3 file
using this information.  However, I would like the filename to contain
only ascii characters, while musicbrainz gives unicode back.  So far,
I've got something like:

>>> artist = u'B\xe9la Fleck'
>>> artist.encode('ascii', 'ignore')
'Bla Fleck'

However, I'd like to see the more sensible "Bela Fleck" instead of
dropping '\xe9' entirely.  I believe this sort of translation can be
done using:

>>> artist.translate(XXXX)

The trick is finding the right XXXX.  Has someone attempted this
before, or am I stuck writing my own solution?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to