Skip to content

Commit

Permalink
Added UTF-8 Support
Browse files Browse the repository at this point in the history
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 <jciccio@gmail.com>
  • Loading branch information
jciccio committed May 29, 2019
1 parent 3c1f19d commit 08a0e14
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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": "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": {
Expand Down
4 changes: 2 additions & 2 deletions react-table-example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 08a0e14

Please sign in to comment.