nullpunkt / lz-string-php

PHP Class implementation of LZ-String javascript
105 stars 53 forks source link

JS compressToUTF16 produces different output than PHP compressToUTF16 #12

Open Turtlehead91 opened 8 years ago

Turtlehead91 commented 8 years ago

Looks like the JS compressToUTF16 produces different output than the PHP copy. I know it's a tedious issue to look into, but is there a chance you could amend the UTF16 to match that of the JS version? I'm working on a project right now that passes compressed data to the server and than expects the PHP to decompress it. It would be a life saver if the PHP UTF16 matched the JS UTF16.

Thanks!

jmo84 commented 6 years ago

Which version of lz-string.js are you using? 1.3.8 from 2015 introduced some breaking changes.

From the lz-string.js readme:

If you are using one of the ports of lz-string to decode on the server what was encoded in the browser, you might want to use version 1.3.7 as the version 1.3.8 introduced a slight change in the encoding.