dosubot[bot] commented on issue #36682:
URL: https://github.com/apache/superset/issues/36682#issuecomment-3665544761
<!-- Answer -->
The CSV_EXPORT encoding setting should control the encoding for both GUI
downloads and email attachments, but if your CSVs are still UTF-8, it's likely
a config loading issue. Superset loads its config once per process at startup,
so you need to make sure your custom superset_config.py (or the config file
with CSV_EXPORT = {"encoding": "cp1250", ...}) is available to every
process—including all web and Celery worker containers—and that you restart all
of them after making changes. If any process (especially a worker) starts with
the default config, it will use UTF-8 regardless of your override
[reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/app.py#L41-L71).
To debug, add a print or log statement in your superset_config.py (e.g.,
print("CSV_EXPORT:", CSV_EXPORT)) and check that it appears in both web and
worker logs after a full restart. Also, verify the actual encoding of the
exported CSVs using a tool like `file` (Linux), Notepad++ (Windows), or
Python's chardet. If the encoding is correct in the file but Excel still shows
garbled characters, it's an Excel import issue—use Excel's "Data > From
Text/CSV" wizard and manually select cp1250
[reference](https://github.com/apache/superset/issues/36374#issuecomment-3601122640).
If you confirm the config is loaded everywhere and the encoding is still
wrong, let me know and we can dig deeper into the export code path.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/f47f4160-2c8d-478e-9638-cb86133ac703?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=The%20CSV_EXPORT%20encoding%20setting%20should%20control%20the%20encoding%20for%20both%20GUI%20downloads%20and%20email%20attachments%2C%20but%20if%20your%20CSVs%20are%20still%20UTF-8%2C%20it%27s%20likely%20a%20config%20loading%20issue.%20Superset%20loads%20its%20config%20once%20per%20process%20at%20startup%2C%20so%20you%20need%20to%20make%20sure%20your%20custom%20superset_config.py%20%28or%20the%20config%20file%20with%20CSV_EXPORT%20%3D%20%7B%22encoding%22%3A%20%22cp1250%22%2C%20...%7D%29%20is%20available%20to%20every%20process%E2%80%94including%20all%20web%20and%20Celery%20worker%20containers%E2%80%94and%20that%20you%20restart%20all%20of%20them%20after%20making%20changes.%20If%20any%20process%20%28especially%20a%20worker%29%20starts%20with%20the%2
0default%20config%2C%20it%20will%20use%20UTF-8%20regardless%20of%20your%20override%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/app.py%23L41-L71%29.%0A%0ATo%20debug%2C%20add%20a%20print%20or%20log%20statement%20in%20your%20superset_config.py%20%28e.g.%2C%20print%28%22CSV_EXPORT%3A%22%2C%20CSV_EXPORT%29%29%20and%20check%20that%20it%20appears%20in%20both%20web%20and%20worker%20logs%20after%20a%20full%20restart.%20Also%2C%20verify%20the%20actual%20encoding%20of%20the%20exported%20CSVs%20using%20a%20tool%20like%20%60file%60%20%28Linux%29%2C%20Notepad%2B%2B%20%28Windows%29%2C%20or%20Python%27s%20chardet.%20If%20the%20encoding%20is%20correct%20in%20the%20file%20but%20Excel%20still%20shows%20garbled%20characters%2C%20it%27s%20an%20Excel%20import%20issue%E2%80%94use%20Excel%27s%20%22Data%20%3E%20From%20Text/CSV%22%20wizard%20and%20manually%20select%20cp1250%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issue
s/36374%23issuecomment-3601122640%29.%0A%0AIf%20you%20confirm%20the%20config%20is%20loaded%20everywhere%20and%20the%20encoding%20is%20still%20wrong%2C%20let%20me%20know%20and%20we%20can%20dig%20deeper%20into%20the%20export%20code%20path.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36682)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]