0

I'm trying to deal with an old server that was resurrected after many years. The problem is that the DB is in a weird state.

The website reads the information from the DB with charset ="windows-1251". The whole table and the fields in the table seen in phpMyAdmin have collation "cp-1251", which I think is the same as windows=1251. If the text is written in latin everything is displayed properly, but if I write the text in Bulgarian it won't work. Any ideas how to fix the DB issue? I have access to the phpMyAdmin & the admin panel of the website.

I was thinking to switch the charset & collation to utf-8 but I get "?" everywhere. Also I looked up similar websites and I saw that they were using charset = windows-1251 for the same fields, which makes me think that the data in the table is not right.

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Lach P.
  • 37
  • 1
  • 8

1 Answers1

1

Either use MySQL's CHARACTER SET utf8 or cp1251.

You will need to switch to that charset throughout

  • the bytes in your client
  • the connection (see set_charaset() in PHP)
  • the column/table (CHARACTER SET ...)
  • html meta.

For further discussion of the question marks, see Trouble with utf8 characters; what I see is not what I stored

In particular, the data was lost as you stored it into the table.

Community
  • 1
  • 1
Rick James
  • 135,179
  • 13
  • 127
  • 222
  • Thanks! I converted the database to utf-8 and now all new information is seen. Now is that the old data is still in cp1251 and I need to convert it, I found out that I can do this by dumping it and importing it as utf-8. The problem is that I have access only to the web hosting Control Panel & I have not set up anything on my computer. Due to this, I have no idea how to do this, could you help me? – Lach P. Mar 09 '17 at 01:15
  • Which situation do you have: http://mysql.rjweb.org/doc.php/charcoll#fixes_for_various_cases (Caution: That writeup is aimed at "having latin1, wanting utf8"; you "have cp1251, want utf8".) – Rick James Mar 09 '17 at 14:09