I am trying to understand the difference between Latin1 and UTF8 and for the most part I get it, however, when testing I am getting some weird results and could use some help clarifying
I am testing with 'é' (Latin small letter E with acute) and the link below shows the hex c3a9
I setup a database and specified utf8 as the character set, then created a table with utf8 as the character set and inserted a record with the character 'é' after setting the connection and client character set to UTF8
when I do a select hex(field), field from test_table I get:
hex(field), field C3A9, é
This is fine and consistent with what I read, however, when I do the exact same using a latin1 character set I get the following:
hex(field), field C3A9, é
but if I enter char(x'E9') which should be the single byte Latin1 equivalent value for é I manage to get it to display correctly using 'set names UTF8' but it doesn't show up correctly when setting the connection and client to Latin1
Can anyone clarify? - shouldn't Latin1 characters be single byte (Hex E9) in both UTF8 and Latin1? or am I completely misunderstanding it all?
Thanks
SHOW CREATE TABLE
so we can see the charset of the table. – redreddingtontest_latin
(a
varchar(500) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 – digital_paki