Reputation: 1
I have a latin1_swedish_ci table that contains cyrillic characters. When I look at the data through phpMyAdmin, it tooks something like:
шòõùцðрÑÂúøõ ñðýúø þтúð÷ыòðютÑÂѠþт ÑÂþñûюôõýøѠтрðôøцøþýýþù тðùýы ø
My goal is to use PHP to fetch each string, send it to Google Translate, and store the result in the MySQL database in a new column.
My problem is that all I get when I query the query is garbage like what you see here. I know that I have to play with the headers, the MySQL connection and the character encoding but I have yet to find something that works. What could I do to get the string in Cyrillic?
Upvotes: 0
Views: 2176
Reputation: 344
If you have a .sql file, edit it, find where it says CREATE TABLE "name of the table here" and at the end change latin1 to utf8. Then import it in your database.
EXAMPLE
ENGINE=InnoDB DEFAULT CHARSET=latin1;
ENGINE=InnoDB DEFAULT CHARSET=utf8;
Upvotes: 1