dosubot[bot] commented on issue #36682:
URL: https://github.com/apache/superset/issues/36682#issuecomment-3665404035
<!-- Answer -->
You don't need to open a new bug report—changing the encoding of CSV email
attachments is supported via configuration. Just set the encoding in your
`CSV_EXPORT` config like this:
```python
CSV_EXPORT = {
"encoding": "cp1250",
"sep": ";",
"decimal": ","
}
```
This setting applies to both GUI CSV downloads and email report attachments.
If your attachments are still UTF-8 after setting this, double-check that the
config is loaded by all Superset processes (including workers) and restart if
needed. Also, make sure your data only contains characters representable in
cp1250, or you may see encoding errors. This approach is confirmed by the code
path for both exports and email reports, which uses the encoding from
`CSV_EXPORT` for CSV generation and attachments
([reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/charts/data/api.py#L346-L412)).
<!-- 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/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/58b279c8-11e1-410d-b49f-b651b1b951b4?feedback_type=other)</sup>
[](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=You%20don%27t%20need%20to%20open%20a%20new%20bug%20report%E2%80%94changing%20the%20encoding%20of%20CSV%20email%20attachments%20is%20supported%20via%20configuration.%20Just%20set%20the%20encoding%20in%20your%20%60CSV_EXPORT%60%20config%20like%20this%3A%0A%0A%60%60%60python%0ACSV_EXPORT%20%3D%20%7B%0A%20%20%20%20%22encoding%22%3A%20%22cp1250%22%2C%0A%20%20%20%20%22sep%22%3A%20%22%3B%22%2C%0A%20%20%20%20%22decimal%22%3A%20%22%2C%22%0A%7D%0A%60%60%60%0A%0AThis%20setting%20applies%20to%20both%20GUI%20CSV%20downloads%20and%20email%20report%20attachments.%20If%20your%20attachments%20are%20still%20UTF-8%20after%20setting%20this%2C%20double-check%20that%20the%20config%20is%20loaded%20by%20all%20Superset%20processes%20%28including%20workers%29%20and%20restar
t%20if%20needed.%20Also%2C%20make%20sure%20your%20data%20only%20contains%20characters%20representable%20in%20cp1250%2C%20or%20you%20may%20see%20encoding%20errors.%20This%20approach%20is%20confirmed%20by%20the%20code%20path%20for%20both%20exports%20and%20email%20reports%2C%20which%20uses%20the%20encoding%20from%20%60CSV_EXPORT%60%20for%20CSV%20generation%20and%20attachments%C2%A0%28%5Breference%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/charts/data/api.py%23L346-L412%29%29.) [](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]