I am maintaining a code that reads data from a MYSQL database and via PHP transforms it into a table and with JQuery it exports it with Excel document. However the accent is all wrong for example:
Ãチrea de Atuação Número
The code I use in Jquery is this:
$(document).ready(function(e) {
//creating a temporary HTML link element (they support setting file names)
var a = document.createElement('a');
var data_type = 'data:application/x-msexcel';
var table_div = document.getElementById('dvData');
var table_html = table_div.outerHTML.replace(/ /g, '%20');
a.href = data_type + ', ' + table_html;
a.download = 'Relatorio_Diplomas_Legais.xls';
a.click();
});
I did not find the parameter that I must pass to encode the text. Could someone tell me what it could be?