Hi Monks, I Try to walk a directory tree to re-tag my mp3 collection.

I have a file (mp3.csv) which contains path;metadata. This file is processed to put the metadata in the corresponding path.

However, when I have my Perl script to go through the file it mostly fails to get to the files and directories as soon as the characters used are UTF8'ish.

Example: a line in the mp3.csv file reads:
/media/usbdisk/music/checkit/Crosby, Stills, Nash & Young/Déjà Vu/01 - Carry On.mp3;Crosby, Stills, Nash & Young;Déjà Vu;Carry On;1;Rock;1970

When I run the script, it says it cannot find the file, thereby displaying:

/media/usbdisk/music/checkit/Crosby, Stills, Nash & Young/D▒j▒ Vu/10 - Everybody I Love You.mp3;Crosby, Stills, Nash & Young;D?j?▒ Vu;Everybody I Love You;10;Rock;1970

As you can see the characters have been messed up, even after I opened the file and manually entered the right characters (of did a copy-paste from the correct directory and filename).

How do I get the script to work properly?

Please monks - help me!

Regards,
John
Ubuntu Hardy, ext3 filesystem, Perl 5.8.8

In reply to encoding problem om Ubuntu Linux by j.goor

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.