Backport PR #8662 (#8872) - Specifying the utf-8 charset when exporting aggregate tables

---------

**Commit 1:**
Specifying the utf-8 charset when exporting aggregate tables

* Original sha: 729bb9a9e4
* Authored by = <brandon.kobel@elastic.co> on 2016-10-13T16:35:52Z

**Commit 2:**
Fixing test. Modified capitalization of utf8 after reading W3C spec

* Original sha: ee22983e7b
* Authored by = <brandon.kobel@elastic.co> on 2016-10-13T16:59:14Z
This commit is contained in:
jasper 2016-10-28 10:40:03 -04:00 committed by Brandon Kobel
parent fa11c034c9
commit 8d26546ebc
2 changed files with 2 additions and 2 deletions

View file

@ -179,7 +179,7 @@ describe('AggTable Directive', function () {
'1,2,"""foobar"""' + '\r\n'
]);
expect(call.args[0].opts).to.eql({
type: 'text/plain'
type: 'text/plain;charset=utf-8'
});
expect(call.args[1]).to.be('somefilename.csv');
});

View file

@ -36,7 +36,7 @@ uiModules
};
self.exportAsCsv = function (formatted) {
let csv = new Blob([self.toCsv(formatted)], { type: 'text/plain' });
let csv = new Blob([self.toCsv(formatted)], { type: 'text/plain;charset=utf-8' });
self._saveAs(csv, self.csv.filename);
};