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”)