Problems decoding base64-encoded GZipped string

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
RobitZee
Junior Member
Junior Member
Posts: 2
Joined: 2018-06-08, 10:54 UTC

Problems decoding base64-encoded GZipped string

Post by *RobitZee »

Hi all

This is my first post here, so please forgive me if it doesn't belong here.. 8)

So, my issue is this:
I have a folder that contains files which is basically a series of ASCII characters representing a base64-encoded GZipped XML string.
I would expect TC to be able to decode the file to the extend where the resulting output file would be the GZip bytes, but this doesn't seem to work :?
No matter if I change the extension from gzb to .b64 - the result is the same: TC throws a dialog that tells me that nothing was decoded.

I'm normally only running the stable releases, but I verified this behaviour with the latest 9.2B6 version too..

Am I going at this the wrong way - or doesn't TC support this?

The contents of one of these gzb files are posted here for testing purposes:

Code: Select all

H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ih7/Hu8WZXqZ101RLT/7aHe881GaL6fVrFhefPbRuj3fPvgo/T2OfuPk8dmyaev1Il+2T7M2e5239GGadj7mz4JPT3/RuljhlxfV0e7u7uO78a/0vS+y5fo8m7brOq+PjssyX6ZP6mxW5teP7wbfafs316v86KRatnVVPq8uineP7/JH+vXrvC6y8kWV3nWIzfJ3/gfPs6Y9ycpiUmctkcB98SJ/F//C+/B1m7XrJvrVq3xV1W30q28XeZ3V0/m1+/ZN3gTkuH9/9979ezSYzuc98r7Km1W1bIpJmSs0n8I6Jd2PMHn/D114IQX5AQAA
Using the online decompression page on the txtwizard site it seems to decompress correctly into the right xml stream:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<InstrumentDataSet>
  <InstrumentData>
    <InstrumentEquipmentNo>111</InstrumentEquipmentNo>
    <Manufacturer>Allen Bradley</Manufacturer>
    <Type>ControlLogix</Type>
    <SerialNo />
    <IndexNo />
    <LastCalibration />
    <NextCalibration />
    <CalibrationStatus />
    <CalibrationReport />
    <CalibrationHierarchy />
    <TestEquipmentNo>551353</TestEquipmentNo>
    <InstrumentResponsible />
  </InstrumentData>
</InstrumentDataSet>
Can anyone verify this behaviour and potentially enlighten me :D

Best Regards
RobitZee
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Hi and welcome!

Excellent report done.

- - -

If I utilize Encode to b64, I get smtg like that

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="BEGINCPP.ZIP"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="BEGINCPP.ZIP"

UEsDBBQAAgAIAKsd/RQHBamdvwUAABQYAAAEAAAAIzEuQ61YTW
...
....
......
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ==


So maybe your files missing that header?

If I remove that header lines, I get the same message as you.



 
RobitZee
Junior Member
Junior Member
Posts: 2
Joined: 2018-06-08, 10:54 UTC

Post by *RobitZee »

Perfect - when I attach a similar header, then it works..
Who would've thought :D

Although I wish TC would support decoding a base64 encoded file without a header :roll:

Thanks for the tip anyway - and have a nice weekend
Post Reply