title: Importing utf-8 encoded csv in meteor using Papa Parse
body: <p>I am having trouble exporting some data from one meteor application (meteor application 1) as a CSV, then uploading that CSV file to a separate meteor application (meteor application 2) . Specifically, while the file is exported from meteor application 1 with utf-8 encoding, I do not know how to “tell” meteor application 2 that the csv encoded in utf-8 format. As a result, the data, as received by meteor application 2 gets corrupted with utf-8 jargon like “%u2019” etc</p>
  
  <p>I’m using the package clinical:csv from atmosphere.js, which is built on top of Papa Parse.</p>
  
  <p>The relevant exporting lines of code in meteor application 1 are:</p>
  
  <pre class="lang-js prettyprint-override"><code>'click #exportMe':function(){
    var csvContent = CSV.unparse(Tasks.find().fetch());
    window.open('data:text/csv;charset=utf-8,' + escape(csvContent), '_self');
  },
  </code></pre>
  
  <p>The relevant importing lines of code in meteor application 2 are:</p>
  
  <pre class="lang-js prettyprint-override"><code>Template.example.events({
    'change #hiddenUpload': function(event){
      var filesList = event.currentTarget.files;
      var file = filesList[0];
      Papa.parse(file, {
          header:true,
          complete: function(results) {
            var data = results.data
            Meteor.call('tasks.batch',data)
          }
        });
    },
  })
  </code></pre>
  
  <p>I would guess that there would be a way of specifying in the importing code, that it’s encoded in utf-8, but have not been able to find anything in any relevant documentation. </p>
  
  <p>Would be really grateful for any help.</p>