title: Saving LZW encoded data into a mySQL database
body: <p>I send zipped data, which is done with LZW compression at the client side with js, to server. The problem is that the data becomes corrupted after saving it to database with SQL.</p>
  
  <p>So my question is, what collation should i use, to accomplish that? (My current one is latin1-default collasion)</p>
  
  <p>I already checked if the problem arrieses during the data transferring from client to server and vice versa by sending encoded data to HTTP-Server and sending(PHP-echo) it back immeadiatly without processing it. I could decode LZW properly. So it should definitely be a problem with the database.</p>
  
  <p>More information about the schema: I only have a single table with a 3 cols. "data" is type of "BLOB". (I also tried TEXT). user_id is INT and type is VARCHAR.</p>
  
  <p>This is how i save the data:</p>
  
  <pre><code>INSERT INTO svg.saved_data (user_id, data, type) VALUES ('".$user_id."', '".$data."', '".$type."');
  </code></pre>