From 08a0e14950822bed66da75d84342aea9f7b902b6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ciccio Date: Wed, 29 May 2019 14:18:43 -0600 Subject: [PATCH] Added UTF-8 Support Added UTF-8 Support for tables - Added accents support for display - Added accents support for downloaded files (CSV files in UTF-8) Signed-off-by: Jose Antonio Ciccio --- README.md | 6 ++++++ package.json | 2 +- react-table-example/src/App.js | 4 ++-- src/index.js | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b225c0..d7c8b9a 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,12 @@ Changes the background to white and the text to blue | caseInsensitive | boolean |N| do searches without casing| # What's new +v0.5.8 + * UTF-8 CSV download support + +v0.5.7 + * Fixed issue introduced in 5.6 (sorry about that) + v0.5.5 * Added prop feature (topPagination) to show pagination at top. diff --git a/package.json b/package.json index f4f7ca5..747537a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-js-table-with-csv-dl", - "version": "0.5.5", + "version": "0.5.8", "description": "React JS tables and log viewer with stats if needed. Has the functionality to dowload table contents in CSV file with data stored in class prop.", "main": "build/index.js", "peerDependencies": { diff --git a/react-table-example/src/App.js b/react-table-example/src/App.js index 03fbe40..b8fdeaa 100644 --- a/react-table-example/src/App.js +++ b/react-table-example/src/App.js @@ -19,8 +19,8 @@ class App extends Component { "Object":[{"id":1000,"values":"K-1"}]}; let table = [ {number: 12, name:"Buffon", position: JSON.stringify(json), success: true}, - {number: 21, name: "Pirlo", position: JSON.stringify(json), success: false}, - {number: 10, name: "Ruiz", position: "MDI"}, + {number: 21, name: "Pirló", position: JSON.stringify(json), success: false}, + {number: 10, name: "Rúiz", position: "MDI"}, {number: 7, name: "Nesta", position: "RB", success: true}, {number: 4, name: "Cannavaro", position: JSON.stringify(json)}, {number: 2, name: "Puyol", position: "CB", success: false}, diff --git a/src/index.js b/src/index.js index 2f3e4f8..b243b91 100644 --- a/src/index.js +++ b/src/index.js @@ -82,7 +82,7 @@ class TableViewer extends Component { } generateAndDownloadCSV() { - let csvType = {type: "data:text/csv;charset=utf-8" }; + let csvType = {encoding:"UTF-8",type:"text/plain;charset=UTF-8"}; let filename = this.props.filename? this.props.filename : "logResults.csv"; var csvContent = ""; var data = this.props.content;