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

fix: add bom to downloaded csv for excel #1430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rchandnaeg
Copy link
Contributor

@rchandnaeg rchandnaeg commented Apr 3, 2024

If you download the result of a query as a CSV and then open the result in Excel, there are encoding issues for unicode/non-latin characters. This PR makes the process of opening a downloaded CSV in Excel a little smoother by adding the Byte Order Mark to the downloaded CSV. There is not a pressing issue with Querybook right now, Excel is just very particular and this makes the downloaded CSVs play nice with Excel's strange encoding import rules.

Example of Issue: Upload the following table and run SELECT * FROM <your-schema>.non_latin_test, then download the results of the query execution

non_latin_test.csv

Opening the result CSV in Excel used to give the following:
image

This PR adds the BOM so that Excel is happy and gets the right encoding:
image

@rchandnaeg rchandnaeg force-pushed the origin/export-csv-into-excel branch from f8f069e to 892d5c1 Compare April 3, 2024 21:27
@jczhong84
Copy link
Collaborator

@rchandnaeg thanks for the PR.

I'm not sure if it is the best way to fix this issue, as some other applications may have issue when the file has BOM. I think a better solution might be to provide a separate option with the BOM, or when user downloads, they have an option to add the bom for ms excel?

@baumandm
Copy link
Contributor

@jczhong84 what do you think about an XLXS export option to avoid this (and other) CSV import issues into Excel?

@jczhong84
Copy link
Collaborator

xlxs export option sounds good to me

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

Successfully merging this pull request may close these issues.

None yet

3 participants