MP3::Tag and UTF8 output



Hi,

iTunes (OS X 10.4) only writes idv2-tags, but some of my old devises read only v1-tags and so I'd like to add v1-tags to my mp3 files accordingly. Since id3ed destrois utf-8 character tags (and so German umlauts), I'd liked to write a perl script which does the job well:

<pre src="~/.profile">
export MP3TAG_DECODE_DEFAULT=UTF8
export MP3TAG_ENCODE_DEFAULT=UTF8
</pre>

The code

<pre src="myscript.pl">
use MP3::Tag;
$mp3 = MP3::Tag->new($ARGV[0]);
@tags = $mp3->autoinfo();
for(@tags){
print $_."\n";
}
</pre>

does not work, it produces:

<pre src="terminal">
Wide character in print at ./mp3tags.pl line 11.
Zu sp?t
Wide character in print at ./mp3tags.pl line 11.
Die ?rzte
</pre>

for "Die Ärzte" and "Zu spät", while <pre>print $ARGV[0]</pre> correctly prints "Zu\ spät.mp3". I've searched and played around with many modules but I couldn't find a solution. What is wrong? Any help?

Thanks in advance,

Sören

.