I start a 8-bit console.
In gnome-terminal I make sure that the console character set is properly set to iso-8859-1:
Terminal -> Character Set Encoding -> Western (ISO-8859-1).
Now I run this command in shell:
and check that the client correctly detected the session character set as latin1:
Now I run:
It correctly returns 0xE4, which is a latin1 code for "U+00E4 SMALL LETTER A WITH DIAERESIS".
Now I use a prepared statement with a user variable as a source:
It also returns the same latin1 code. So far so good.
Now I use a prepared statement with a string literal as a source:
It returns a different result. C3A4 is a utf8 code for "U+00E4 SMALL LETTER A WITH DIAERESIS". Conversion from latin1 to utf8 happened.