Skip to content

Commit

Permalink
Backport PR elastic#8662 (elastic#8872) - Specifying the utf-8 charse…
Browse files Browse the repository at this point in the history
…t when exporting aggregate tables

---------

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

* Original sha: 729bb9a
* Authored by = <[email protected]> on 2016-10-13T16:35:52Z

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

* Original sha: ee22983
* Authored by = <[email protected]> on 2016-10-13T16:59:14Z
  • Loading branch information
elastic-jasper authored and kobelb committed Oct 28, 2016
1 parent fa11c03 commit 8d26546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ui/public/agg_table/__tests__/_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/agg_table/agg_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 8d26546

Please sign in to comment.