I send LZW compressed data from the client side with JavaScript to the server. The problem is that the data becomes corrupted after saving it to database.
So my question is, what collation should I use to accomplish that?
(My current one is latin1-default
.)
I already checked if the problem arises during the data transfer from client to server and vice versa by sending encoded data to the HTTP server and sending it back (PHP-echo) immediately without processing it. I could decode LZW properly. So it should definitely be a problem with the database.
More information about the schema: I only have a single table with three columns:
data BLOB -- I also tried TEXT
user_id INT
type VARCHAR
This is how I save the data:
INSERT INTO `svg`.`saved_data` (`user_id`, `data`, `type`)
VALUES ('{$user_id}', '{$data}', '{$type}');