[delphizip] Re: error when reading a zip file in another PC

  • From: "RPeters" <rpeters@xxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Thu, 26 Jul 2007 18:02:22 +1000

I think that should remove your problem.
I am working on a better file name verification function but I have not =
had
much time to do so.

- Russell Peters
> -----Original Message-----
> From: delphizip-bounce@xxxxxxxxxxxxx [mailto:delphizip-
> bounce@xxxxxxxxxxxxx] On Behalf Of Edwin
> Sent: Thursday, 26 July 2007 5:48 PM
> To: delphizip@xxxxxxxxxxxxx; delphizip@xxxxxxxxxxxxx
> Subject: [delphizip] Re: error when reading a zip file in another PC
>=20
> Tahnsk James,
> So the only thing I can do is to show a more meaningful error messag?
>=20
> If I use standard TOpenFileDialog other than the TNT controls, and get
> the file name as string other than WideString, will this problem =
fixed?
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> Best Regards,
> Edwin
> http://www.innovationgear.com
> MindVisualizer -- Productive Visual Mind Mapping Software
> 2007-07-26
>=20
>=20
>=20
> Sender=A3=BA James Turner
> Sent=A3=BA 2007-07-24 17:38:46
> Recipient=A3=BA delphizip@xxxxxxxxxxxxx
> CC=A3=BA
> Subject=A3=BA [delphizip] Re: error when reading a zip file in another =
PC
>=20
> If corruption results from codepage conversions, ultimately, those
> conversions will have to be corrected or eliminated. It sounds as
> though
> correction is likely to be impossible, so that leaves elimination.
>=20
> Perhaps you could validate conversions (by reversing and comparing =
with
> the original) - that way, you could at least detect conversion errors
> and issue a meaningful error message.
>=20
> Perhaps you could save the original filename (raw) in the ExtraData of
> the file. This will be valid provided unzipping occurs on a similar
> computer (but would be a lot of work and doesn't address the immediate
> problem).
>=20
> -- James Turner
>=20
> Edwin wrote:
> > Hi Russell Peters,
> > According to the further study, I think you are right, it most =
likely
> that the problem is some characters in the path cannot be converted,
> i.e. some traiditional chinese cannot be converted into simplified
> Chinese.......
> >
> > What u can think I can solve the prolbem? How great the ZipMaster
> supports unicode...
> >
> >
> >
> >
> > Best Regards,
> > Edwin
> > http://www.innovationgear.com
> > MindVisualizer -- Productive Visual Mind Mapping Software
> > 2007-07-24
> >
> >
> >
> > Sender=A3=BA RPeters
> > Sent=A3=BA 2007-07-11 19:14:21
> > Recipient=A3=BA delphizip@xxxxxxxxxxxxx
> > CC=A3=BA
> > Subject=A3=BA [delphizip] Re: error when reading a zip file in =
another PC
> >
> > The big problem may be what it does with characters that will not =
(or
> > cannot) convert - often these result in an invalid character as far
> as =3D
> > paths
> > or filenames are concerned.
> >
> > A reasonably easy test is to call FindFirst and check the Windows
> error
> > (probably bad filespec - I cannot recall the exact error codes at =
the
> > moment).
> >
> > - Russell Peters
> >
> > > -----Original Message-----
> > > From: delphizip-bounce@xxxxxxxxxxxxx [mailto:delphizip-
> > > bounce@xxxxxxxxxxxxx] On Behalf Of Edwin
> > > Sent: Wednesday, 11 July 2007 7:47 PM
> > > To: delphizip@xxxxxxxxxxxxx; delphizip@xxxxxxxxxxxxx
> > > Subject: [delphizip] Re: error when reading a zip file in another
> PC
> > > =3D20
> > > Thanks for your info James.
> > > I use Tntsystem.WideStringToStringEx(str, DefaultSystemCodePage) =
to
> do
> > > the conversion, it internally calls WideCharToMultiByte. Not sure =
=3D
> > >
> > where
> >
> > > the problem comes from, Tntsystem.WideStringToStringEx works well
> > > elsewhere so far.............
> > > =3D20
> > > =3D20
> > > =3D20
> > > =3D20
> > > Best Regards,
> > > Edwin
> > > http://www.innovationgear.com
> > > MindVisualizer -- Productive Visual Mind Mapping Software
> > > 2007-07-11
> > > =3D20
> > > =3D20
> > > =3D20
> > > Sender=3DA3=3DBA James Turner
> > > Sent=3DA3=3DBA 2007-07-11 17:32:40
> > > Recipient=3DA3=3DBA delphizip@xxxxxxxxxxxxx
> > > CC=3DA3=3DBA
> > > Subject=3DA3=3DBA [delphizip] Re: error when reading a zip file in
> another =3D
> > >
> > PC
> >
> > > =3D20
> > > Using the short filename **might** work since it probably has only
> > > ascii
> > > characters (never checked this).
> > > =3D20
> > > Are you using standard Delphi conversions or working with
> > > MultibyteToWideChar and WideCharToMultibyte directly?
> > > =3D20
> > > If you use the style ES_OEMCONVERT in any editboxes, this might
> > > generate
> > > a conversion problem (never studied this).
> > > =3D20
> > > -- James Turner
> > > =3D20
> > > Edwin wrote:
> > >   > Do you mean call GetShortPathName before setting the value of
> the
> > > ZipFileName property? The path name and file name that the user
> > > reported did not exceed the max. 255 characters.
> > >   > BTW, since I use WideString as much as I can in the program,
> the =3D
> > >
> > path
> >
> > > name is converted from WideString to string before assigning to =
the
> > > property TZipMaster.ZipFileName, using the routines in the TNT =3D
> > >
> > Controls
> >
> > > package, I'm not sure is there error in the conversion....
> > >   >
> > >   >
> > >   >
> > >   >
> > >   > Best Regards,
> > >   > Edwin
> > >   > http://www.innovationgear.com
> > >   > MindVisualizer -- Productive Visual Mind Mapping Software
> > >   > 2007-07-11
> > >   >
> > >   >
> > >   >
> > >   > Sender=3DA3=3DBA James Turner
> > >   > Sent=3DA3=3DBA 2007-07-09 19:16:49
> > >   > Recipient=3DA3=3DBA delphizip@xxxxxxxxxxxxx
> > >   > CC=3DA3=3DBA
> > >   > Subject=3DA3=3DBA [delphizip] Re: error when reading a zip =
file in
> =3D
> > >
> > another PC
> >
> > >   >
> > >   > It's just a guess, but perhaps using the short filename would
> help.
> > >   >
> > >   > This can be found using the API function GetShortPathName. On
> some
> > >   > versions of Windows, it can be found from the property sheet.
> > >   >
> > >   > -- James Turner
> > >   >
> > >   > RPeters wrote:
> > >   >
> > >   >   > I would say it is quite likely.
> > >   >   > My understanding is that the UNC 'share name' still =
follows
> the =3D
> > >
> > old
> >
> > >   >   > restricted character rules - if I am wrong I will quite a
> bit of
> > > code to
> > >   >   > adapt.
> > >   >   >
> > >   >   > I doubt that 1.79 (or earlier) is very friendly with MBCS
> > > characters either.
> > >   >   > If you are using 1.79 you could have it generate a log =
file
> (put =3D
> > >
> > an
> >
> > >   >   > appropriate ini file in the same folder as the dll).
> > >   >   > - Russell Peters
> > >   >   >
> > >   >   >
> > >   >   >   > -----Original Message-----
> > >   >   >   > From: delphizip-bounce@xxxxxxxxxxxxx =
[mailto:delphizip-
> > >   >   >   > bounce@xxxxxxxxxxxxx] On Behalf Of Edwin
> > >   >   >   > Sent: Monday, 9 July 2007 6:54 PM
> > >   >   >   > To: delphizip@xxxxxxxxxxxxx
> > >   >   >   > Subject: [delphizip] error when reading a zip file in
> another PC
> > >   >   >   >
> > >   >   >   > Dear sir/Madam,
> > >   >   >   >
> > >   >   >   > Error when reading a zip file which is located in
> another PC and
> > > the
> > >   >   >   > UNI path reads like \\pc1\folder1\my_file.zip, where
> folder1
> > > contains
> > >   >   >   > Chinese characters.  This error is reported by one of
> my users
> > > and I
> > >   >   >   > cannot reproduce this error in my office. Any tips
> would be
> > >   >   >   > appreciated.
> > >   >   >   >
> > >   >   >   > BTW, Is the archive of this list available?
> > >   >   >   > --------------
> > >   >   >   > Best Regards,
> > >   >   >   > Edwin
> > >   >   >   > http://www.innovationgear.com
> > >   >   >   > MindVisualizer -- Productive Visual Mind Mapping
> Software
> > >   >   >   > 2007-07-09
> > >   >   >   >
> > >   >   >   > -----------
> > >   >   >   > To unsubscribe from this list, send an empty e-mail
> > >   >   >   > message to:
> > >   >   >   >   delphizip-request@xxxxxxxxxxxxx
> > >   >   >   > and put the word unsubscribe in the subject.
> > >   >   >   >
> > >   >   >   > __________ NOD32 2384 (20070708) Information =
__________
> > >   >   >   >
> > >   >   >   > This message was checked by NOD32 antivirus system.
> > >   >   >   > http://www.eset.com
> > >   >   >   >
> > >   >   >   >
> > >   >   > -----------
> > >   >   > To unsubscribe from this list, send an empty e-mail
> > >   >   > message to:
> > >   >   >   delphizip-request@xxxxxxxxxxxxx
> > >   >   > and put the word unsubscribe in the subject.
> > >   >   >
> > >   >   >
> > >   >   >
> > >   > -----------
> > >   > To unsubscribe from this list, send an empty e-mail
> > >   > message to:
> > >   >   delphizip-request@xxxxxxxxxxxxx
> > >   > and put the word unsubscribe in the subject.
> > >   >
> > >   >
> > >   > -----------
> > >   > To unsubscribe from this list, send an empty e-mail
> > >   > message to:
> > >   >   delphizip-request@xxxxxxxxxxxxx
> > >   > and put the word unsubscribe in the subject.
> > >   >
> > >   >
> > > -----------
> > > To unsubscribe from this list, send an empty e-mail
> > > message to:
> > >   delphizip-request@xxxxxxxxxxxxx
> > > and put the word unsubscribe in the subject.
> > > =3D20
> > > =3D20
> > > -----------
> > > To unsubscribe from this list, send an empty e-mail
> > > message to:
> > >   delphizip-request@xxxxxxxxxxxxx
> > > and put the word unsubscribe in the subject.
> > > =3D20
> > > __________ NOD32 2392 (20070711) Information __________
> > > =3D20
> > > This message was checked by NOD32 antivirus system.
> > > http://www.eset.com
> > >
> >
> >
> > -----------
> > To unsubscribe from this list, send an empty e-mail
> > message to:
> >   delphizip-request@xxxxxxxxxxxxx
> > and put the word unsubscribe in the subject.
> >
> >
> > -----------
> > To unsubscribe from this list, send an empty e-mail
> > message to:
> >   delphizip-request@xxxxxxxxxxxxx
> > and put the word unsubscribe in the subject.
> >
> >
> -----------
> To unsubscribe from this list, send an empty e-mail
> message to:
>   delphizip-request@xxxxxxxxxxxxx
> and put the word unsubscribe in the subject.
>=20
>=20
> -----------
> To unsubscribe from this list, send an empty e-mail
> message to:
>   delphizip-request@xxxxxxxxxxxxx
> and put the word unsubscribe in the subject.
>=20
> __________ NOD32 2421 (20070725) Information __________
>=20
> This message was checked by NOD32 antivirus system.
> http://www.eset.com


-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: