[Flac] convert metaflac tags to utf-8?

Josh Coalson xflac at yahoo.com
Mon Feb 27 10:59:52 PST 2006


--- Eric Sandeen <sandeen at sandeen.net> wrote:
> Hi, I realize that this is not strictly flac-related, but...
> 
> I've got my collection in flac now, and at the end of the endeavor, I
> 
> realized that (I think...) I've managed to have a few different 
> encodings in the tags, one way or another.
> 
> For instance:
> [root at localhost Zen Arcade]# metaflac --list 01-Something\ I\
> Learned\ 
> Today.flac > 1
> [root at localhost Zen Arcade]# metaflac --no-utf8-convert --list 
> 01-Something\ I\ Learned\ Today.flac > 1.no
> [root at localhost Zen Arcade]# file 1 1.no
> 1:    ASCII text
> 1.no: ISO-8859 text
> [root at localhost Zen Arcade]# cat 1 1.no | grep -i artist
>      comment[0]: ARTIST=H#sker D#
>      comment[0]: ARTIST=H?sker D?
> 
> so I've done something wrong here I think :)
> 
> Is there an existing tool to go through & convert all my flac tags to
> UTF-8 (and then I will probably manually fix up the few files such as
> the above...)  If such a thing does not exist, any suggestions for 
> writing one?

metaflac --export-tags-to/--import-tags from *may* work, e.g.

metaflac --export-tags-to=tag.from file.flac &&
iconv -f LATIN-1 -t UTF-8 tag.from >tag.to &&
metaflac --remove-all-tags --import-tags-from=tag.to file.flac

(of course test that real well first since it's destructive.  it
also assumes you know the current encoding.  a better script will
also check the iconv result for warnings.)

see
http://flac.sourceforge.net/documentation.html#metaflac_shorthand_import_tags_from

the docs say import doesn't support multiple tags with the same
field name but looking at the code that doesn't appear to be a
problem, but double-check.

Josh


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Flac mailing list