Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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? In reply to How to fix wrongly encoded filenames? by mcc001
|
|