You are not logged in.
Hi Folks,
I'm trying to use SynLZO unit with Synopse.inc file in order to use the compression functions available. I gave a look at the code, but I'm a free pascal beginner yet. Could you show me how to call CompressSynLZO function?
I'm trying like this:
CompressSynLZO(string_to_be compressed, True)
But it allways return:
synlzo
It seems that the function was programmed to allways return this...
Can you help me?
Best regards
Last edited by DeBritto (2016-06-22 13:25:10)
Offline
Yes, this function always returns "synlzo".
SynSelfTests.pas is often a good place to have an idea about how to use a function.
Line 8179 (TTestCompression._SynLZO) and further of this file.
You will see that the anistring s is compressed and decompressed !
Offline
Hi AOG,
Thank you so much for your reply.
just one more thing. When I try to save the compressed string into a Blob database field (Firebird 2.5 with charset utf8) I receive this message: error - malformed string.
I have no idea of what is happening. Can you help me. My aim is to compress a string to sabe it on a blob field in order to reduce network latency.
Yes, this function always returns "synlzo".
SynSelfTests.pas is often a good place to have an idea about how to use a function.
Line 8179 (TTestCompression._SynLZO) and further of this file.
You will see that the anistring s is compressed and decompressed !
Offline
I am sorry, but I do not know how to help you with this error.
The compressed string is just a string. So, it should work.
However, many problems stem from utf8 / ansi codepage problems.
Perhaps you could try base64 encoding of your string ?
Offline
Hi AOG,
Thank you so much. I used base64 encondig of the compressed string before I save that on the Blob field. It's working now! Perfect.
Offline