Sorjan for the curve code. The problem is all described in the subject. The script produces a file without a name and format. The format is changing, the file is opened, and Russian characters are not displayed. I honestly understand this completely. Hardly wrote a calculator for commercial offers. It is necessary that the table was saved in Excel. I would be grateful for any help.

<script type="text/javascript"> var tableToExcel = (function() { var uri = 'data:application/vnd.ms- excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft- com:office:office" xmlns:x="urn:schemas- microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head><!--[if gte mso 9]><xml> <x:ExcelWorkbook><x:ExcelWorksheets> <x:ExcelWorksheet><x:Name>{worksheet} </x:Name><x:WorksheetOptions> <x:DisplayGridlines/></x:WorksheetOptions> </x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--> </head><body><table>{table}</table></body></html>' , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function (s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML} window.location.href = uri + base64(format(template, ctx)) } })() </script> 
  • A full xls has a different signature - DD CF 11 E0 A1 B1 1A E1 filesignatures.net ... , what is on the screen is not xls. This is the html version of excel, which only the Windows excel understands. The html encoding is set by <meta content tags, plus it is very desirable that the encoding of the page is where the script, the encoding of the page from which the script is called, and the encoding in the generated file were the same, otherwise you will have to deal with encoding conflicts. There are other versions. To create a full xls need other methods. - nick_n_a

0