Created
January 11, 2010 08:05
-
-
Save yongbin/274080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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