Thank you for the suggestion! Unfortunately convmv failed to recognize my charset GB18030 (however, iconv recognizes it). I already wrote an email to the author about this problem.
you might be better off using perl or python to read in your file list, perform the conversion, then rename the files. The biggest issue with using shell scripting is spaces, tabs, newlines, backticks, single and double quotes, and parenthesis:
* Cool mp3 from Jack's party (December 2003 "xmas").mp3
Your filenames might not even resemble anything like that, but if the shell even interrprets it as a quote or parenthesis, then poof it all breaks.
Try this, but you'll have to emerge Text-Iconv.
Uncomment the rename line, if you feel like it's gonna work :)
--snip here---
#!/usr/bin/perl use strict; use Text::Iconv;
my $converter = Text::Iconv->new("GB18030", "UTF-8");sub iconv { return $converter->convert(shift); }sub docmd
{
my ($d,$f)[EMAIL PROTECTED];
my $n=&iconv($f);
# rename "$d/$f", "$d/$n";
print "$d: $f->$n\n";
}sub dodir
{
my $d=shift;
opendir(DIR,$d);
my @dirs = grep { !(/^\.\.?$/ && -d "$d/$_") } readdir(DIR);
closedir(DIR);
map {-d "$d/$_"?&dodir("$d/$_"):&docmd($d,$_);} @dirs;
}&dodir("/tmp");exit;
-- [email protected] mailing list
