An annoying encoding error worries about a new dataset in a mongoDB insert and stops my script when there is a encoding issue?
PHP Fatal error: Uncaught exception 'MongoException' with message 'non-utf8 string: ü'
How to fix the new dataset before the PHP driver breaks?
Is there a better idea than utf8_encode any string data, even those that are already utf8?
Had the same issue. This works:
$string = mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8');
utf8_encode()
( http://php.net/manual/en/function.utf8-encode.php ) since the default PHP encoding is still not utf8 yet I think (not sure about PHP 5.4).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With