Compressing a string with PHP / decompressing with VB?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Compressing a string with PHP / decompressing with VB?

Post by Swede78 »

I'm trying to compress a dynamically created string that can be read by software on a client computer via an http connection. The programmer of the software needs to be able to decompress this data using Visual Basic. But he cannot decompress it when it's compressed using PHP's functions; gzcompress, gzencode, or bzcompress. Does anyone have any suggestions of how we can make PHP compression work with VB compression?
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

1. zlib (gzip) is a standard compression format which is independent of either php or VB.
2. Info on libraries for different languages can be found in most unlikely of places: http://www.gzip.org/ - look for the zlib libraries...there is one for VB.
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post by Swede78 »

Thank you Maugrim, I'll take a look. Otherwise, the VB programmer thinks they can get BZip to work.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

You should be able to get either working for VB - all you need is the necessary compression library for VB, include it in your project, and use whatever API it offers. Google can probably supply any number of tutorials on setting this up if required...:)
Swede78
Forum Contributor
Posts: 198
Joined: Wed Mar 12, 2003 12:52 pm
Location: IL

Post by Swede78 »

The programmer can get files to work with compression and decompression, but not strings.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

From a quick google search of "vb.net zlib string compression":

http://www.eggheadcafe.com/articles/20011226.asp
http://www.eggheadcafe.com/articles/20011229.asp
Post Reply