Skip to content

Instantly share code, notes, and snippets.

@yongbin
Created January 11, 2010 08:05
Show Gist options
  • Save yongbin/274080 to your computer and use it in GitHub Desktop.
Save yongbin/274080 to your computer and use it in GitHub Desktop.
# yuni 님이 작성하신 mac itunes 용 mp3 encoder
#!/opt/local/bin/perl5.10
use warnings;
use strict;
use MP3::Tag;
use Data::Dumper;
use Encode qw/encode decode/;
binmode STDOUT, ":utf8";
my $filename = shift @ARGV;
my $mp3 = MP3::Tag->new($filename);
my $info = $mp3->autoinfo();
my %ninfo;
foreach my $k (keys %$info) {
my $v = $info->{$k};
printf "%s : %s => %s\n", $k, $v, from_euckr($v);
$ninfo{$k} = from_euckr($v);
}
$mp3->update_tags(\%ninfo);
$mp3->update_tags();
sub from_euckr {
return decode('euc-kr', $_[0]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment