Editor 1.7.3 : error message if json_encode fails
Editor 1.7.3 : error message if json_encode fails
![madmike](https://secure.gravatar.com/avatar/cefde5c328d2ddb5c764fa60a7f94b69/?default=https%3A%2F%2Fvanillicon.com%2Fcefde5c328d2ddb5c764fa60a7f94b69_200.png&rating=g&size=120)
in Bug reports
HI, using Editor 1.7.3, I'm receive an error message :
{"error":"JSON encoding error: Malformed UTF-8 characters, possibly incorrectly encoded"}.
- How I can have mode information to debug. ?
- Is it possible to add something to force utf encoding if not ?
Thanks for help.
Mike
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @madmike ,
Has the database been set to support UTF-8?
Cheers,
Colin
Yes it is.
I temporary solve using a query in the database : https://stackoverflow.com/questions/1476356/detecting-utf8-broken-characters-in-mysql
But there is a way to avoid that in Editor, or add a treatment in the PHP json answer ? And where do that ?
Thanks
Try calling:
Just before you create the Editor PHP instance.
Allan
@allan thanks a lot
HI , you write to set $db->sql( 'set names utf8' ); but I have no idea in what file I have to write this. my main file is ritbeheer that calls ritten.php just like in the trial package is called staff.php.
![](https://datatables.net/forums/uploads/editor/61/qmnuz3v109v7.png)
my structure is ;
I have been searching for days now but have no clue.
Put it just before your
Editor:inst( $db .... )
call.Allan