Home

Add a comment

 

Avatar: pieroxy

demo page over reports the uncompressed size

Internal representation of string in memory, localStorage, Indexed DB... are all using UTF16. These strings are effectively consuming two bytes per character, even for US-ASCII characters. Now, if encode those strings in UTF-8, I agree with you.

LZString is meant for the browser. Browser use UTF-16. localStorage quotas are by character, hence US-ASCII characters use 16 bits each.

This is why the demo page reflects this fact by counting all input characters as two bytes. Because they consume that many bytes.


demo page over reports the uncompressed size


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