I have an array that contains strings that can be in many languages, and have REALLY strange chars (result of parsing the data from files that may have chinese chars, the result can be very weird).
In order to prevent errros during sql inserts, i'm using the following line:
$foo = utf8_encode(utf8_normalize_nfc(serialize($data)));
But when i fetch the data from the DB, can't apply unserialize
$retrive_foo = unserialize(stripcslashes(utf8_decode($data)));
[phpBB Debug] PHP Notice: in file [ROOT]/includes/functions_foo.php on line 290: unserialize(): Error at offset 853 of 1356 bytes
[phpBB Debug] PHP Notice: in file [ROOT]/includes/functions_foo.php on line 291: unserialize(): Error at offset 1112 of 4851 bytes
Some ideas of how handle this?