Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output has non-printable chars #22

Closed
AnishJoseph opened this issue Apr 27, 2017 · 8 comments
Closed

Output has non-printable chars #22

AnishJoseph opened this issue Apr 27, 2017 · 8 comments

Comments

@AnishJoseph
Copy link

AnishJoseph commented Apr 27, 2017

When i export a csv file i get 3 unprintable chars in the beginning of the file - hex values are ef, bb and bf. Am using chrome Version 57.0.2987.133 (64-bit) on OSX. I am using react-csv version 1.0.8
I notice in core.js the following function

var buildURI = exports.buildURI = function buildURI(data, headers, separator) {
  return encodeURI('data:text/csv;charset=utf-8,\uFEFF' + toCSV(data, headers, separator));
};

If i remove the \uFEFF, as given below then the output is as expected without the non-printable chars.

var buildURI = exports.buildURI = function buildURI(data, headers, separator) {
  return encodeURI('data:text/csv;charset=utf-8,' + toCSV(data, headers, separator));
};

Not sure what the issue is.

@jimulle
Copy link
Collaborator

jimulle commented Aug 29, 2017

I see the same behavior as @AnishJoseph. What is the reason for the \uFEFE?

@nicoleivanov
Copy link

Going to comment this here as well, just in case anyone else is following this. @jimulle I just tried to implement the simple example download link and data, and I am having this issue of the 3 unreadable characters appearing in the first cell of the document when it opens in excel from Chrome. Do you know how I can fix this? It works just fine through the link in the examples page http://elegance.abdennoor.com/react-csv/ so I'm not sure why it's not working for me.

@mccabemj
Copy link
Collaborator

@nicoleivanov are you using the latest version, since the fix above?

@nicoleivanov
Copy link

@mccabemj I believe I was, but I'm no longer using react-csv, so this isn't an issue for me anymore. Thanks!

@pepijnolivier
Copy link

pepijnolivier commented Aug 5, 2019

@nicoleivanov Could you share what you're now using instead ?

@AnishJoseph
Copy link
Author

AnishJoseph commented Aug 5, 2019 via email

@nicoleivanov
Copy link

@pepijnolivier I just made my own implementation. No library, sorry!

@monossido
Copy link

Solved by adding
uFEFF={false}

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

No branches or pull requests

6 participants