1

I have a latin1 table that was filled with different encoded data for a long time so it contains a lot of broken characters. I was trying to fix that and How to detect UTF-8 characters in a Latin1 encoded column - MySQL to be very helpful, especially the following code

SELECT CONVERT(CONVERT(name USING BINARY) USING latin1) AS latin1, CONVERT(CONVERT(name USING BINARY) USING utf8) AS utf8 FROM users WHERE CONVERT(name USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']')

but this does not fix all the issues. The ä character displayed as "ä" is converted back to ä with that command, but I also have some ä characters showing up as "„" so it seems a different encoding format was used, but I have no idea which one that was so I could revert it. I tried through the available charsets on the mysql server but no proper result. Has anyone experienced this issue before and can point me to the correct character set?

Community
  • 1
  • 1
Clemens Valiente
  • 829
  • 1
  • 8
  • 16
  • Bear in mind that just because a character is *displayed* as "„" doesn't mean that's how it's stored: undesirable conversion may have occurred between the database and your output medium. The best way to verify that data is stored using the correct encoding is to fetch a hex representation of it with MySQL's [`HEX()`](http://dev.mysql.com/doc/en/string-functions.html#function_hex) function (and compare against that which one expects for the data). – eggyal Oct 31 '12 at 18:10

0 Answers0