Hi there,
Using perl v5.10.1 (build 1006) built for MSWin32-x86-multi-thread on Windows XP, I am working on a simple Perl script to find pdf files from a Windows folder.
However, I spent already 2 days trying to figure out why I would sometimes have files with their correct names and sometimes file names with the DOS 8.3 format.
What I have discovered so far is that some files contains the Unicode Character 'MINUS SIGN' (U+2212) in their name and all of them can't be read correctly by Perl subroutines and are changed to DOS 8.3 filenames.
For instance: COPYOF~1.PDF is displayed whereas the file name is actually "Copy of PCO-1810.pdf" (minus sign is different than the standard ASCII/Windows dash, might come from MAC users but I am not sure).
I have tried almost everything I could understand about this problem:
_ used chdir/readdir,
_ used File::find,
_ used <*.pdf> on a folder handle,
_ tried to convert output from unicode to utf8 or latin1,
_ tried to use perl -CSDA to launch the script...
Do you guys have any information why the DOS 8.3 file names are displayed whereas a simple "dir" on the folder in windows DOS prompt display all files without problem?
Is it a bug or am I missing something?
Thanks a lot in advance for your help.
Regards.
Azulito
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.