Added encoding selecting options

This commit is contained in:
Pedro Markun
2012-04-14 14:39:41 -03:00
parent c16fc1204e
commit 6a352f9c44
3 changed files with 11 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ this.recline.Backend = this.recline.Backend || {};
(function($, my) {
my.loadFromCSVFile = function(file, callback, options) {
var encoding = options.encoding || 'UTF-8';
var metadata = {
id: file.name,
file: file
@@ -16,7 +18,7 @@ this.recline.Backend = this.recline.Backend || {};
reader.onerror = function (e) {
alert('Failed to load file. Code: ' + e.target.error.code);
};
reader.readAsText(file);
reader.readAsText(file, encoding);
};
my.csvToDataset = function(csvString, options) {