$tmp = iconv('YOUR CURRENT CHARSET', 'UTF-8', $string);
or
$tmp = utf8_encode($string);
It is strange that in the end you get an empty row in your database. I can understand that in the end you will have some garbarge, but nothing (empty line) is weird.
I just typed this in the console:
iconv -l | grep -i ansi
He showed me:
ANSI_X3.4-1968 ANSI_X3.4-1986 ANSI_X3.4 ANSI_X3.110-1983 ANSI_X3.110 MS-ANSI
These are the possible values for YOUR CURRENT SHARSET. As stated earlier, when your input line contains characters allowed in UTF, you do not need to convert anything.
Change UTF-8 to UTF-8 // TRANSLIT when you do not want to skip characters, but replace them with a similar one (when they are not in the UTF-8 set)
source share