Home

Add a comment

 

Avatar: pieroxy

Re: Long time it has been released: lz-string :)

I assume both previous comments were from you. What you need to check is that the String you are feeding decompressFromBase64() on the C# side is the exact same as the string you are getting from compressToBase64() from your browser. My guess is that they are not the same, because some of the characters in base64 need to be URL encoded.

You should use compressFromEncodedURIComponent(). This is like base64 but the characters chosen are slightly different (see the last two chars below). With a couple of replaces on the server side - String.replace("-","/") and String.replace("$","=") - you should get back the original base64 string. Just feed that to decompressFromBase64() in your C# app.

The characters used for base64: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=

The characters used for uricomp: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$

If you still have issues, please open a bug into the C# repo (I'm not the author of the C# code)


Re: Long time it has been released: lz-string :)


Title
Body
HTML : b, strong, i, em, blockquote, br, p, pre, a href="", ul, ol, li, sub, sup
OpenID Login
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

Home