Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Download CSV breaks for '#' chars in Firefox #85

Open
aarose opened this issue Feb 8, 2016 · 0 comments
Open

Download CSV breaks for '#' chars in Firefox #85

aarose opened this issue Feb 8, 2016 · 0 comments

Comments

@aarose
Copy link

aarose commented Feb 8, 2016

To reproduce:

  1. Open Firefox
  2. Go to http://jsfiddle.net/cqjvD/1069/ (or any export-csv enabled chart with a series that has the "#" character in the name)
  3. Click "Download CSV" from the drop-down menu
  4. Examine the CSV - the data is blank

Source:

The source of this issue seems to be in Highcharts.Chart.prototype.downloadCSV, when passing 'data:text/csv,' + csv.replace(/\n/g, '%0A'), as the href param.

Proposed solution:

Add .replace(/#/g, '%23') to encode the "#" character. Encoding the string could also be passed off to a new function that could encode all the special characters at once, not just newlines and "#".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant