-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Choose encoding when export csv #1519
Comments
We should just probably export the csv encoded in utf-8. Isn't this the case? If so and excel cannot handle it, that's an excel issue. Btw what do you mean with ansi? |
You're right, it's an excel issue. But the truth is, people not familiar with encoding will always use excel to open csv. So I think maybe it's better to let them choose encoding(gbk) which I tell them to when exporting csv. |
You can add utf8 file header manually, to tell software decode it with utf8 |
PR welcomed! |
We are having issues with csv default encoding (and default separator as well) too. Would you be interested in a PR that allows to choose csv encoding and separator using the config.py ? We were thinking about adding two variables in config.py (CSV_SEP and CSV_ENCODING) to be able to change the default way of writing CSV (values would be retrieved when calling to_csv method). Does it sound right to you ? |
I tried to adding the CSV_ENCODING in config.py like #3441, In Python3.5 it doesn't work,however in Python2.7 it works well. |
Yes I noticed this too ... I am planning on issuing a new PR (today) to fix this using flask Response encoding. |
I modify config.py: But it doesn't work.Using vim to view the downloaded file: Do I have an operation in error? |
now if you solve this problem? i am in this trouble now. @chengwei1231 |
in /views/core.py, i change Response to CsvResponse. |
@chuancyzhang Could you explain more detail? you mean |
For those who are still suffering from csv export encoding matters, The encoding should be changed accodingly to your requirement. |
It was useful for me to change default delimiter to ;
It allows to import CSV to MS Excel without any additional actions |
Encoding option was really useful, thanks! |
Is there any plan to add this feature that I can choose encoding when export csv?
Because Excel uses the ansi to open the csv files, Chinese is mess code.
The text was updated successfully, but these errors were encountered: