Audio-TagLib-1.43
perl v5.8.8 built for i586-linux-thread-multi
Linux 2.6.18.8-0.1-default #1 SMP Fri Mar 2 13:51:59 UTC 2007 i686
athlon i386 GNU/Linux
Audio::TagLib::String does something horrible to strings which have the
UTF8 flag set. See the attached test case, the album tag is ruined
after it's written out to file.
Subject: | audio-taglib.t |
#!/usr/bin/perl
use strict;
use diagnostics;
use Audio::TagLib qw();
use Devel::Peek qw(Dump);
use Test::More tests => 2;
sub setalbum {
my $fname = shift;
my $str = shift;
my $f = Audio::TagLib::FileRef->new($fname);
$f->tag->setAlbum(Audio::TagLib::String->new($str));
$f->save;
};
sub getalbum{
my $fname = shift;
return Audio::TagLib::FileRef->new($fname)->tag->album->toCString;
};
# --
my $fname = '01.mp3';
for (
'123',
"\x{4e00}\x{4e8c}\x{4e09}", # yi'ersan
) {
diag Dump $_;
setalbum $fname, $_;
ok getalbum($fname) eq $_;
};