1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

set encoding for to UTF-8 for csv parser

This commit is contained in:
Kyle Spearrin
2016-10-17 23:00:44 -04:00
parent 4c0bde9d87
commit 52b3dfd0e3

View File

@@ -44,6 +44,7 @@
function importLocal(file, success, error) {
Papa.parse(file, {
header: true,
encoding: 'UTF-8',
complete: function (results) {
var folders = [],
sites = [],
@@ -105,16 +106,22 @@
if (pre.length === 1) {
csv = pre.text().trim();
results = Papa.parse(csv, { header: true });
results = Papa.parse(csv, {
header: true,
encoding: 'UTF-8'
});
parseData(results.data);
}
else {
var foundPre = false;
for (var i = 0; i < doc.length; i++) {
if (doc[i].tagName === 'PRE') {
if (doc[i].tagName.toLowerCase() === 'pre') {
foundPre = true;
csv = doc[i].outerText.trim();
results = Papa.parse(csv, { header: true });
results = Papa.parse(csv, {
header: true,
encoding: 'UTF-8'
});
parseData(results.data);
break;
}
@@ -133,6 +140,7 @@
else {
Papa.parse(file, {
header: true,
encoding: 'UTF-8',
complete: function (results) {
parseData(results.data);
}
@@ -191,6 +199,7 @@
function importSafeInCloudCsv(file, success, error) {
Papa.parse(file, {
header: true,
encoding: 'UTF-8',
complete: function (results) {
var folders = [],
sites = [],
@@ -310,6 +319,7 @@
function importPadlockCsv(file, success, error) {
Papa.parse(file, {
encoding: 'UTF-8',
complete: function (results) {
var folders = [],
sites = [],