I need a function or class to ensure that data sent from a form ( from anywhere in the world ) goes to the database in UTF-8 encoding.
I have tried, $string = iconv(mb_detect_encoding($text), "UTF-8", $text);
but it has problems (if the entry is 'nation' it returns 'na').
I have tried $string = mb_convert_encoding($text, "UTF-8");
but also have problems return na