My script for creating MP3 files from FLAC files has broken in Fedora
17.  Specifically, tags with accented characters are getting truncated
when I try to write them as UTF-16LE (which seems to be what most
players expect).  The script, which I am attaching, worked fine when I
last used it in January back in January (presumably on Fedora 16).

Here is an example of what I'm seeing:

[pilcher@ian music]$ metaflac --show-tag=title track05.flac
title=Lento, rĂ¡pido

[pilcher@ian music]$ flac2mp3 track05.{flac,mp3}

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh
Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for
details.

track05.flac: done
LAME 3.99.5 64bits (http://lame.sf.net)
polyphase lowpass filter disabled
Encoding <stdin> to track05.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=0)

[pilcher@ian music]$ id3v2 -l track05.mp3
id3v2 tag info for track05.mp3:
TSSE (Software/Hardware and settings used for encoding): LAME 64bits
version 3.99.5 (http://lame.sf.net)
TIT2 (Title/songname/content description): Lento, r
TPE1 (Lead performer(s)/Soloist(s)): Unknown
TALB (Album/Movie/Show title): Spanish Schoolhouse
TRCK (Track number/Position in set): 5
TCON (Content type): Children's (255)
TLEN (Length): 118013
track05.mp3: No ID3v1 tag

You can see that the TIT2 tag has been truncated at the accented
character.

I am seeing exactly the same thing when I try to add the tag with id3v2.

I found a report of similar behavior in Debian here:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655738

but my LANG is definitely set to en_US.UTF-8.  (I verified that this is
true during script execution by adding an echo statement.)

Any ideas?  (My wife is from Peru, so being unable to add songs with
accented characters in the title to her Squeezebox is really, really
important.)

Thanks!

-- 
========================================================================
Ian Pilcher                                         arequip...@gmail.com
"If you're going to shift my paradigm ... at least buy me dinner first."
========================================================================
#!/bin/bash

FLAC_FILE="$1"
MP3_FILE="$2"

ABSOLUTE_FLAC_FILE=`readlink -m "$FLAC_FILE"`
ART_FILE="${ABSOLUTE_FLAC_FILE%/*}/front.jpg"

TITLE=`metaflac --show-tag=title "$FLAC_FILE" | sed 's/^title=//' | iconv -f 
UTF-8 -t UTF-16LE`
ARTIST=`metaflac --show-tag=artist "$FLAC_FILE" | sed 's/^artist=//' | iconv -f 
UTF-8 -t UTF-16LE`
GENRE=`metaflac --show-tag=genre "$FLAC_FILE" | sed 's/^genre=//' | iconv -f 
UTF-8 -t UTF-16LE`
ALBUM=`metaflac --show-tag=album "$FLAC_FILE" | sed 's/^album=//' | iconv -f 
UTF-8 -t UTF-16LE`
TRACKNUMBER=`metaflac --show-tag=tracknumber "$FLAC_FILE" | sed 
's/^tracknumber=//' | iconv -f UTF-8 -t UTF-16LE`

if [ -f "$ART_FILE" ]; then
    flac -dc "$FLAC_FILE" | lame -V0 --id3v2-only --id3v2-utf16 --tt "$TITLE"  
--ta "$ARTIST" --tl "$ALBUM" --tn "$TRACKNUMBER" --tg "$GENRE" --ti "$ART_FILE" 
- "$MP3_FILE"
else
    flac -dc "$FLAC_FILE" | lame -V0 --id3v2-only --id3v2-utf16 --tt "$TITLE"  
--ta "$ARTIST" --tl "$ALBUM" --tn "$TRACKNUMBER" --tg "$GENRE" - "$MP3_FILE"
fi
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to