Hello good people,
I have a specific use case where I need the user to upload xls files which might have different 2 encoding types.
Unfortunately using encoding = “auto” doesn’t do the trick with one of them, so I would to try opening the file with one encoder and then move to the next one if the first fails. Right now the only workaround I could think of is the following:
try: uploaded_file = st.file_uploader(type="xls", encoding = 'GB18030', key = 'a') except: uploaded_file = st.file_uploader(type="xls", encoding = 'utf-16-le', key = 'b')
Which as you can imagine it is not very clean as it forces the user to select the file a second time if the decoding fails
Any thoughts on how I could solve this?