I am trying to fix some corruption to character fields in my database after a migration. I suspect that part of the problem is that fields with UTF-8 data were interpreted with the MySQL latin1
character set. Before I try to fix the problem, I want to understand it. Part of that is to understand exactly what the latin1
character set is.
What is the formal definition of mapping between code points (byte values) and characters for the latin1
character set in MySQL 8.0, and in MySQL 5.7? If collation matters, I will take the answer for latin1_swedish_ci
collation.
latin1
is said to be identical to the Windows CP-1252 encoding. In the Wikipedia article on CP-1252, there is a table of 256 byte code values, with a character in each cell of the table. That is the sort of definition I am after. But, I am hoping for something more rigorous than "it's the same as CP-1252" and "that table in Wikipedia is probably accurate".
I have tried looking through the MySQL documentation. I hoped that 10.10.2 West European Character Sets would like to the formal definition, but I do not see it there. Nor do I see an answer here, or on Wikipedia.
If there is a MySQL source file which defines latin1
, and I can view that source file via a URL, that might well be good enough. But if someone has made up a 256-cell table, that is even better.