Skip to content

Commit

Permalink
Merge pull request #24 from smartprocure/feature/utf8-support
Browse files Browse the repository at this point in the history
Properly handle UTF8 characters.
  • Loading branch information
dubiousdavid authored Nov 13, 2018
2 parents adc7295 + 7f40e57 commit e378aee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.1.1
- Properly handle UTF8 strings.

# 2.1.0
- Added `autoDetectColumns` setting to allow an array of objects to be passed in and column names to be auto-detected. `columnKeys` can be passed in with `autoDetectColumns` set to true to indicate the desired column order.
- Properly quote cells and escape double-quotes when `addQuotes` settings is true.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csv-generator-client",
"version": "2.1.0",
"version": "2.1.1",
"description": "Library to generate downloadable csv files from client side data.",
"main": "lib/csv-generator-client.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/csv-generator-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let getData = ({ separator, addQuotes }, dataArray) => {
data =>
typeof window !== 'undefined' && window.navigator.msSaveBlob
? data
: btoa(data)
: btoa(unescape(encodeURIComponent(data)))
)(dataArray)
}

Expand Down

0 comments on commit e378aee

Please sign in to comment.