Click here to get back home

Archive::Zip problem

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Archive::Zip problem Mike Scott 07-03-2006
Posted by Mike Scott on July 3, 2006, 5:25 am
Please log in for more thread options


Maybe I've misunderstood something. But when calling $zip->contents() I
keep getting characters added and/or replaced within the returned string.

EG the following code snippet:

$content = 'content.txt';
my $zip = Archive::Zip->new('test.zip');
my ($contentstring, $status) = $zip->contents($content);
print "after reading contents: +++", $contentstring, "+++\n";

The member content.txt contains, simply,
XXXchar="dot"XXX

However the returned string, in this case, is prefixed with extra weird
characters:

%od -ab ~/xxxx
0000000 a f t e r sp r e a d i n g sp c o
141 146 164 145 162 040 162 145 141 144 151 156 147 040 143 157
0000020 n t e n t s : sp + + + ef bb bf X X
156 164 145 156 164 163 072 040 053 053 053 357 273 277 130 130
0000040 X c h a r = " d o t " X X X + +
130 143 150 141 162 075 042 144 157 164 042 130 130 130 053 053
0000060 + cr nl
053 015 012
0000063

(Note the hex ef, bb, bf inserted.)

In general, at least some non-ascii bytes are changed too - I'm trying
to work with OpenOffice files, and for example the 'bullet' character
comes out wrongly.

Oddly though, if I use extractTree() to make a file copy of content.txt,
that appears to be accurate, a least in this test case.

The same problem occurs on XP and freebsd installations, both using 1.16
of archive::zip.

Can anyone clue me into what's going on here please?

--
Please use the corrected version of the address below for replies.
Replies to the header address will be junked, as will mail from
various domains listed at www.scottsonline.org.uk
Mike Scott Harlow Essex England.(unet -a-t- scottsonline.org.uk)

Similar ThreadsPosted
Archive::Tar August 14, 2004, 9:41 am
[ANN] Archive::Zip 1.12 released July 12, 2004, 8:21 pm
Archive::Tar on win32 September 16, 2004, 8:40 am
[ANN] Archive::Zip 1.14 released October 22, 2004, 4:04 pm
[ANN] Archive::Zip 1.14 released October 22, 2004, 11:03 pm
Using Archive::Zip extractTree(); January 2, 2007, 4:33 pm
Archive::Tar fails tests on AIX August 17, 2004, 6:30 pm
ANNOUNCE: Archive::Zip 1.13 released August 23, 2004, 4:49 pm
Archive::Zip missing pod2man? September 12, 2004, 7:33 pm
Archive::Tar and how to handle *.bz2 archives? September 13, 2005, 3:18 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap