Several connections to MySQL disturb unicode

I have unicode everywhere, but Scriptcase connections to MySQL disturb. (To see and switch coding I use Notepad++)

. When reading data from a database different from the database of the application I now detect the coding and adjust to utf8.
This leads to correct unicode.
$NameOfDog = mb_convert_encoding($NameOfDog, ‘UTF-8’, mb_detect_encoding($NameOfDog, “UTF-8, ISO-8859-1, ISO-8859-15”, true));

. When writing to a database whichs differs from the database of the application I have to adjust to ISO-8859-1 to write properly on the production server, because Scriptcase stores ?? unwanted in the unicode.
$NameOfDog = mb_convert_encoding($NameOfDog, ‘ISO-8859-1’, mb_detect_encoding($NameOfDog, “UTF-8, ISO-8859-1, ISO-8859-15”, true));

Production environment, Cpanel:
… fan è âlde … - Correct special signs as in Doglisting in MySQL database 1.
… fan è âlde … - Written from an application Doglisting in table Entries in database 2.
… fan è âlde … - Dog name gets correctly written in Entries, but with change to ISO-8859-1 first.

Development environment, Cpanel:
… fan è âlde … - Correct, also when deployed.
… fan - with change to ISO-8859-1 first.