Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>"when stored in localStorage, do they stay unicode?"</strong></p> <p>The <a href="http://www.w3.org/TR/webstorage/#the-storage-interface" rel="nofollow noreferrer">Web Storage working draft</a> defines local storage values as DOMString. <a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-C74D1578" rel="nofollow noreferrer">DOMStrings are defined</a> as sequences of 16-bit units using the <a href="http://en.wikipedia.org/wiki/UTF-16/UCS-2" rel="nofollow noreferrer">UTF-16 encoding</a>. So yes, they stay Unicode.</p> <p><strong>is there a way I could compress the string to use all of the data in a unicode byte</strong>...<strong>?</strong></p> <p>"Base32k" encoding should give you 15 bits per character. A base32k-type encoding takes advantage of the full 16 bits in UTF-16 characters, but loses a bit to avoid tripping on double-word characters. If your original data is base64 encoded, it only uses 6 bits per character. Encoding those 6 bits into base32k should compress it to 6/15 = 40% of its original size. See <a href="http://lists.xml.org/archives/xml-dev/200307/msg00505.html" rel="nofollow noreferrer">http://lists.xml.org/archives/xml-dev/200307/msg00505.html</a> and <a href="http://lists.xml.org/archives/xml-dev/200307/msg00507.html" rel="nofollow noreferrer">http://lists.xml.org/archives/xml-dev/200307/msg00507.html</a>.</p> <p>For even further reduction in size, you can decode your base64 strings into their full 8-bit binary, compress them with some known compression algorithm (e.g. see <a href="https://stackoverflow.com/questions/294297/javascript-implementation-of-gzip">javascript implementation of gzip</a>), and then base32k encode the compressed output.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload