Hi,
Problem: Reading the directory contents of a directory
on a Microsoft Windowsserver 2008 SP2.
The contents of the directory was created by the commandline
version of 7zip while unpacking a TAR-archive, which
was created on a UNIX-system. The filenames contain characters outside ASCII.
Symptoms and reason for them: The filenames were encoded in
latin1 and were put as bytestrings on the filesystem of the
Windowsserver and then tagged being of the encoding scheme
of the Windowsserver without being altered on byte level.
The command 'dir' of that directory shows the correct count
of characters, but the NON-ASCII-characters are shown as 'grey blcoks'.
The same directory shown in the Windows Explorer shows them
in the 8.3 scheme of DOS and an attached ~<number>.
I need to read the directory with perl in the way command.com sees the directory and to fix the problem WITHOUT changing the bytes of the filename as such.
I tried many versions of encode/decode/use bytes/pack-unpack. Too many to post them here.
How can I fix that with Perl only?
Thank you very much in advance!
Best regards,
mcc
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.