title: Accented letters not showing properly when exporting CSV using javascript
body: <p>I am doing an export to CSV functionality on my website. The data are in spanish so there will be alot of accented characters in there, and one example of this problem is the header "Año" (year) but on excel it shows as "AÃ±o".</p>
  
  <p>Here is my export code using javascript:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;a href="#" class="btn" id="export-btn"&gt; Export&lt;/a&gt;
  &lt;a href="#" class="btn" id="download" style="display:none"&gt; Download Now &lt;/a&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$(document).on('click', '#export-btn', function(e) {
  
      var _this = $(this);
      _this.attr('disabled',true);
  
      var datenow = new Date();
          datenow = datenow.getTime();
  
      var exportdata = ConvertToCSV(exportdata);
  
      $('#download').attr("href", "data:text/csv;charset=utf8," + encodeURIComponent(exportdata) );
      $('#download').attr("download", "InTrack-Report-"+datenow+".csv");
  
      $('#download').show(); //show download button
  
      _this.attr('disabled',false);
  
  });
  </code></pre>
  
  <p>here is the <strong>ConvertToCSV</strong> function, I added <code>sep=;</code> to make excel recognize the semicolon as delimiters.</p>
  
  <pre><code>function ConvertToCSV(objArray) {
      var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
      var str = 'sep=;\r\n'; //tell excel that we used semicolon as separator
  
      //header
      var line = '';
      for (var i = 0; i &lt; array.Fields.length; i++) {
          if (line != '') line += ';'
          line += array.Fields[i]['Title'];
      }
      str += line + '\r\n';
  
      //rows
      for (var i = 0; i &lt; array.Rows.length; i++) {
          var line = '';
          for (var index in array.Rows[i]) {
              if (line != '') line += ';'
  
              line += array.Rows[i][index];
          }
  
          str += line + '\r\n';
      }
  
      return str;
  }
  </code></pre>
  
  <p><hr>
  <strong>UPDATE:</strong>
  I found a way to display the accented letters properly by following the solution <a href="https://stackoverflow.com/questions/18249290/generate-csv-for-excel-via-javascript-with-unicode-characters">here</a>. But I had to remove the <code>sep=;</code> which is important as it separates my data by semicolon. Is there a way to add both the BOM and the <code>sep=;</code> at the top? If so, how? Because it seems like I can only use one.
  <br><br>
  So instead of <code>str='sep=;\r\n'</code> it is now <code>str='\uFEFF sep=;\r\n'</code></p>