ASCII - Invalid JSON Response
ASCII - Invalid JSON Response
Couldn't find a topic specific to this.
I have a datatable with one column which holds quite random information. An example from this column are the characters ✔ï¸áµ›áµ‰Ê³á¶¦á¶ á , with this result causing the specific datatable page it was on to be inaccessible due to the improper json (invalid json response). The other pages work fine.
Is there a recommended way to get around this? The data comes from the ajax method (serverside php) and I've been unable to properly sanitize the specific column (only need just the one column).
Thanks.
Answers
Hi @MikeyMatou ,
Have you tried specifying the
contentType
as discussed in this StackOverflow thread?Cheers,
Colin
Unfortunately, I just tried to no avail @colin . Still the same issue.
Have you tried the steps in the link provided in the error?
https://datatables.net/manual/tech-notes/1
Specifically using jsonlint. Can you provide an example of your JSON response?
Kevin
Hate to say it, I think you just have to poke around the web - it's not a DataTables issue as such. This link may help, as may this.
C
Is it binary data rather than encoded text? If it is encoded text then it sounds like a character encoding issue - JSON is UTF8, so you need to create the JSON as UTF8 on the server-side.
If its binary data, then you'd probably need to strip it since that can indeed be invalid UTF8.
Allan