Download csv with chinese characters

I have a pandas data frame with Chinese characters. This works fine:

df.to_csv(‘file.csv’, encoding = ‘utf-8-sig’)

But, when introducing the streamlit download button, the Chinese characters can’t get encoded correctly. Code:

file = df.to_csv(encoding = ‘utf-8-sig’)
st.download_button(“Download”, file,“file.csv”)

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.