laziness, impatience, and hubris | |
PerlMonks |
Re^2: How to fix wrongly encoded filenames?by mcc001 (Initiate) |
on Mar 17, 2014 at 17:53 UTC ( [id://1078641]=note: print w/replies, xml ) | Need Help?? |
Hi,
thank for the code! :)
One problem is to read the corrupted filenames off the filesystem without getting the shortened 8.3 form. What happens is: 7zip, which is used to unpack the the TAR-archive, doesnt know the encoding scheme of the filenames and tagged them as cdp437 (while they are latin1). Windows sees the cdp437-flag and encodes the latin1-filename from cdp437 to the underlaying UTF16 (I think this is used internally). The result is a latin1-bytestring converted from cdp437 to UTF16 which results in encoding-nonsense.
The logik which I want to implement (and currently dont
know how) in Perl is:
First goal is to read the full (and garbled) filename from the filesystem. I cannot identify the part of the code above, which reads the filenames off the filesystem, which definetly is a result of my being a novice and no monk...;)
How can I implement the algorithm described above?
In Section
Seekers of Perl Wisdom
|
|