Character encoding issues in MySQL
- by Eric
In my database we have fields where the data is not readable. I now know why it happened but I don't know how to fix it.
I found a way to get the info back from the database:
SELECT id,
name
FROM projects
WHERE LENGTH(name) != CHAR_LENGTH(name);
One of the rows returned shows:
id | name
-------------------------
1008 | Cajón el Diablo
This should be:
id | name
-------------------------
1008 | Cajón el Diablo
Can somebody help me figure out how to fix this problem? How can I convert this using SQL? Is SQL not good? If not, how about Python?