title: Lossless compression method to shorten string before base64 encoding to make it shorter?
body: <p>just built a small webapp for previewing HTML-documents that generates URL:s containing the HTML (and all inline CSS and Javascript) in base64 encoded data. Problem is, the URL:s quickly get kinda long. What is the "de facto" standard way (preferably by <strong>Javascript</strong>) to compress the string first without data loss?</p>
  
  <p>PS; I read about Huffman and Lempel-Ziv in school some time ago, and I remember really enjoying LZW :)</p>
  
  <p>EDIT:</p>
  
  <p>Solution found; seems like rawStr => utf8Str => lzwStr => base64Str is the way to go. I'm further working on implementing huffman compression between utf8 and lzw. Problem so far is that too many chars become very long when encoded to base64.</p>