login about faq

While using CkZip and CkZipEntry's unzipToString to open the docProps/custom.xml from a Microsoft Word document, I noticed that the last character in the Xml is missing for some reason.

The code is somewhat like this:

CkZipEntry *zipentry = zip.GetEntryByName(_T("docProps/custom.xml"));
const char *charXml = zipentry->unzipToString(0, _T("utf-8"));

The character that is missing is the ending ">" of the "<Properties>" node.

My environment is VC++ 11 and Chilkat v4 (obviously) in win32 mode.

asked Apr 03 '13 at 12:33

roan98dk's gravatar image

roan98dk
326192034


link

answered Apr 08 '13 at 12:05

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Unfortunately there are too many other changed in the pre-release for me to easily test it. I would have to make too many other changes only to test this or create a simple console application. I am considering going with the second alternative so that I always have an almost empty project, where I can test these types of changes.

(Apr 09 '13 at 08:26) roan98dk

Hmm, I decided to try it anyway in my project, but while testing I notice that CkZipCrc::FileCrc() suddenly returns 0. Has this class been deprecated in favor of CkCrypt2?

(Apr 09 '13 at 09:04) roan98dk

No, this was a temporary error introduced in the pre-release that has not yet been released. I made the fix and will upload a new build later and will post here when it's ready.

(Apr 09 '13 at 13:03) chilkat ♦♦

I uploaded the new builds to the same URL as before. This fixes the FileCrc problem..

(Apr 10 '13 at 08:49) chilkat ♦♦

I have responded with an answer only to format code. It would be nice if comments also supported a little bit of formatting.

(Apr 10 '13 at 09:38) roan98dk

Now I am suddenly faced with another problem while getting the ZipEntry to process:

ChilkatLog:
  GetEntryByName:
    DllDate: Apr 10 2013
    ChilkatVersion: 9.4.1.0
    UnlockPrefix: XXXXXXXX
    Username: XXXX:XXXXXX
    Architecture: Little Endian; 32-bit
    VerboseLogging: 0
    filename: docProps/custom.xml
    File not found in zip archive
  --GetEntryByName
--ChilkatLog

The code worked fine in 9.4.0:

CkZipEntry *entry = zip.GetEntryByName(_T("docProps/custom.xml"))

The entry above is null/empty, but it does exist in the zip file. Here is the zip content as XML:

<zip_contents>
    <dir name="_rels">
        <file>.rels</file>
    </dir>
    <dir name="word">
        <dir name="_rels">
            <file>document.xml.rels</file>
            <file>header2.xml.rels</file>
        </dir>
        <dir name="theme">
            <file>theme1.xml</file>
        </dir>
        <dir name="media">
            <file>image1.png</file>
        </dir>
        <file>document.xml</file>
        <file>endnotes.xml</file>
        <file>fontTable.xml</file>
        <file>footer1.xml</file>
        <file>footer2.xml</file>
        <file>footer3.xml</file>
        <file>footnotes.xml</file>
        <file>header1.xml</file>
        <file>header2.xml</file>
        <file>header3.xml</file>
        <file>numbering.xml</file>
        <file>settings.xml</file>
        <file>styles.xml</file>
        <file>webSettings.xml</file>
    </dir>
    <dir name="docProps">
        <file>app.xml</file>
        <file>core.xml</file>
        <file>custom.xml</file>
    </dir>
    <file>[Content_Types].xml</file>
</zip_contents>
link

answered Apr 10 '13 at 09:37

roan98dk's gravatar image

roan98dk
326192034

The fix for the GetEntryByName problem has been uploaded to the same URL.

Note: This is a problem that existed only in the pre-release of the new version (v9.4.1). These issues are due to the fact that significant internal work on the Zip class has taken place, namely to support ZipX and to eliminate the need for temp files, as well as certain performance improvements -- such as when opening large zip archives.

(Apr 10 '13 at 11:29) chilkat ♦♦

Ok, I will wait to test this as well as SendRate callback in CkHttpProgress until 9.4.1 is close to completion.

(Apr 10 '13 at 11:57) roan98dk

I'm facing the same issue: unzipToString is missing the last character.

But the download links above are not working. Where can I get the fixed version for .NET 4.0?

link

answered Jul 09 '13 at 12:24

ixm7's gravatar image

ixm7
632210

Looks like Chilkat just released the newer version and that's why the links above no longer work. All is well :o)

link

answered Jul 09 '13 at 14:41

ixm7's gravatar image

ixm7
632210

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×27
×20
×7
×3

Asked: Apr 03 '13 at 12:33

Seen: 1,749 times

Last updated: Jul 09 '13 at 14:41

powered by OSQA