my $fn = shift;
my @l;
- open(F, '-|', 'metaflac', '--export-cuesheet-to=-', $fn);
+ open(F, '-|', 'metaflac', '--no-utf8-convert', '--export-cuesheet-to=-',
+ $fn);
while (<F>) {
/INDEX 01 (\d\d):(\d\d):(\d\d)$/ or next;
push(@l, [$1, $2, $3]);
my $outdir;
my $outfile;
- open(my $fp, '-|', 'metaflac', '--export-tags-to=-', $fn)
- or die("open(metaflac --export-tags-to=- $fn): $!");
+ open(my $fp, '-|', 'metaflac', '--no-utf8-convert', '--export-tags-to=-',
+ $fn)
+ or die("open(metaflac --no-utf8-convert --export-tags-to=- $fn): $!");
($artist, $album, $discnum, @tags) = get_tags($fp, $fn);
- close($fp) or die("close(metaflac --export-tags-to=- $fn): $?");
+ close($fp)
+ or die("close(metaflac --no-utf8-convert --export-tags-to=- $fn): $?");
for ($artist, $album) {
s/'/'\\''/g;
s|/|_|g;
my %tracks_to_tags;
my @disc_artist;
my @tmp;
+ my $hack = 1;
for my $tag (@tags) {
if ($tag =~ /^([^[]+)\[(\d+)]=(.*)/) {
push(@{$tracks_to_tags{$2}->{$1}}, $3);
+ } elsif ($tag =~ /^TITLE=(.*)/) {
+ push(@{$tracks_to_tags{$hack++}->{'TITLE'}}, $1);
} elsif ($tag =~ /^ARTIST=/) {
push(@disc_artist, $tag);
} else {