Server-side JSON with accented char

Server-side JSON with accented char

itajackassitajackass Posts: 162Questions: 48Answers: 3
edited April 2018 in Free community support

I use server side processing to retrieve a JSON.

This work:

{
  "draw": 1,
  "recordsTotal": 57,
  "recordsFiltered": 57,
  "data": [
    [
      "Test",
      "Test"
    ],
...
}

But this NOT ( ì causing problem):
I get error: DataTables warning: table id=tabellaRisultati - Invalid JSON response.

{
  "draw": 1,
  "recordsTotal": 57,
  "recordsFiltered": 57,
  "data": [
    [
      "Testì",
      "Test"
    ],
...
}

How to solve this ?

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    This is valid JSON:

    {
        "draw": 1,
        "recordsTotal": 57,
        "recordsFiltered": 57,
        "data": [
            [
                "Testì",
                "Test"
            ]
        ]
    }
    

    So there must be something else causing the issue. Can you give us a link to the page or use the debugger please?

    Allan

  • itajackassitajackass Posts: 162Questions: 48Answers: 3

    I'm working on localhost sorry.
    I tried also on jsfiddle and it work! :(
    http://jsfiddle.net/nzn5m6vL/553/

    So the problem is on my localhost but i don't know where...

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    That's odd that it's working on the fiddle, but not locally. Are there different library versions involved? Or something other interactions going on perhaps?

    C

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Is your page UTF8? Have you set the mime type for it in the header? Likewise is your database connection UTF8? Is the database's character set UTF8?

    Allan

This discussion has been closed.