Getting Error DataTables warning: table id=employee-grid - Invalid JSON response
Getting Error DataTables warning: table id=employee-grid - Invalid JSON response
Sanit Kale
Posts: 23Questions: 9Answers: 0
I am Getting Error Invalid JSON I am Showing Address, CompanyName, Street In Datatable And for some users, there are German, French Characters.
while showing it in Datatable its Getting Invalid JSON.
I don't know why it is throwing Error for Non-ASCII Characters ??
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @Sanit Kale ,
If you're having problems with non-ascii characters, it's most likely something to do with your UTF8 settings. Take a look at this thread, this should help.
Cheers,
Colin
Beyond that, what is being returned from the server that is not valid JSON? It might contain a useful error message.
Allan
I have Converted all Database Into Utf8mb4 and still, i am getting the same error
The thing is i have junk Address and if I remove Space or single character from that address (not junk character) then Its working fine.
If i remove any space from above address its working
Have you checked the response from the server as I suggest above? Does it contain an error message? If not, then check your server's error logs.
Allan
Thank Allan for a reply
Actually, I am not getting any response from the server, I ran a query to search for HOP Character When I paste that Character here I am not able to see that HOP Character so I have attached the screen Shot. I am removing this character manually from the database but not found any solution.
Did you check the server's error logs? My guess is that
json_encode()
is objecting to that character, but I can't be certain.Allan
What needs to be done to make it work ?
Actually I dumped json data and found
�zveren
this character in LastName Field.I am not getting any response from server
actual LantName is
Özveren
Its a character encoding issue. As I asked before, and tangerine highlighted, please check your server's error logs. Not the response from the server. The error logs.
You probably need to use UTF8 or whatever character set you need consistently. It sounds like the database table might be in some other encoding.