title: datatables rejects en dashes
body: <p>My server response feeds data from the DB into <code>datatables</code> and I get an error when the data fed in the <code>aaData</code> segment contains <a href="https://unicodelookup.com/#%E2%80%93/1" rel="nofollow noreferrer">en dashes</a>. The error I get is:</p>
  
  <blockquote>
    <p>DataTables warning (table id = 'resultTable'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.</p>
  </blockquote>
  
  <p>I know the en dash causes this because data containing it is the only time I get this error. Is there a way I can encode the data that I feed to datatables, that would prevent this kind of error?</p>
  
  <p>JSON (note the en dash in <code>test–Data</code>):</p>
  
  <pre><code>{
    "sEcho": 1,
    "iTotalRecords": 1,
    "iTotalDisplayRecords": 1,
    "aaData": [
      [
        "testData|test–Data|test–Data",
        "testData",
        "Published",
        "2016-11-22"
      ]
    ]
  }
  </code></pre>