I've had a similar problem and for me the solution was to identify binary/character data and handle it appropriately.
my $mp3 = MP3::Tag->new($t);
The module returns a character string (Dec '08); so that's OK. Make sure any applications writing the tags encode properly. For linux, Easytag seems to work very well.
my $tag_dir = "/music/$a_artist/$a_name";
What you want as a human but no good for mkpath() et al
my $binary_tag_dir = encode_utf8($tag_dir);
ah, now this is mkpath()-able

Now, File::Find (properly) returns a binary string so needs decoding. Assuming your filesystem uses utf8 encoding:

my $char_file_find_dir = decode("utf8",$File::Find::dir);
At this point you can print and compare $char_file_find_dir and $tag_dir.

You can also compare and do filename tests etc with $binary_tag_dir and $File::Find::dir.

When printing (including debugging) I had:

binmode STDOUT, ":utf8";
This tells perl that my terminal is utf8 aware and to print accented characters appropriately.

You should also encode() the binary strings before printing them if you want to read them (or not if you want to 'od' them)

HTH

Corretcions welcome ;)


In reply to Re^3: MP3::Tag encoding problem by lbt
in thread MP3::Tag encoding problem by mfearby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.