1

I have a database with charset latin1 and collation latin1_swedish_ci. I use a proper UTF-8 header in PHP. Also I use Zend Framework 1 with charset utf-8 for operations with the database.

Recently I've got my database filled with values like:

old correct value 1: Have baby will travel

new incorrect value 1: Ü€l„„&ŽW4ó$ ®ôwzñAº:+T£”ìß‚¬*o

old correct value 2: Run of the farm

new incorrect value 2: ·ç›Ú]#æèèèf?6‰a

old correct value 3: Movie Maker

new incorrect value 3: ÅÚñ

I tried all solutions from I need help fixing Broken UTF8 encoding but nothing works for me.

And I still don't know if it was a virus or a charset bug.

Community
  • 1
  • 1
see613
  • 494
  • 5
  • 16
  • Please provide `SELECT HEX(col), col FROM tbl` – Rick James Mar 30 '15 at 16:50
  • @RickJames hex is here http://we.tl/iwtpeIxKxY – see613 Mar 30 '15 at 17:29
  • OK, garbage occurred on _input_. This is not a form of garbage that I recognize. Please provide `SHOW CREATE TABLE` and explain the actions taken to `INSERT` into the table. – Rick James Mar 30 '15 at 17:35
  • @RickJames http://pastebin.com/ANKwyJUw I don't do anything special for INSERT. I use Zend 1 and data saving looks like $this->table->update($this->data, "id = ".$this->id);. By the way after the accident I've enabled mysql log and I have one strange query. It looks like a common query the site uses but with wrong data. http://pastebin.com/36Pjj9B6 – see613 Mar 30 '15 at 17:56
  • Where did the text for that pastebin come from? It is unrecognizable by me. Assuming the UPDATE set `posts` with that gibberish, I see that `name` is latin1, yet the pastebin shows what looks like utf8 byte-pairs (). Can you back up another step in the history of this 'garbage'? – Rick James Mar 30 '15 at 18:12
  • @RickJames unfortunately I have only one strange query because I enabled the log too late. – see613 Mar 30 '15 at 18:16
  • @RickJames this query looks like when we update entries in the admin panel but this particular query has strange data. Possibly someone broke in the admin panel and updated all entries with random symbols. – see613 Mar 30 '15 at 18:22

0 Answers0