Hi, Retool community!
I'm encountering an issue related to character encoding and would appreciate some assistance.
I have file input component where users can upload csv files.
This leads me to believe that there might be something distinct about the file causing this behavior. I'm wondering if there's a way to resolve this issue?
If anyone has insight into what might be causing this discrepancy and how to address it, I would greatly appreciate your assistance. Thank you!
Yes, I receive it. There seem it has a bug with Retool to deal with UTF-8 file.
but the docs of fileUtils is not explain how to use parameter of options
Hey folks! Sorry for the late reply here. If you're seeing the � character in the CSV itself, i.e. the character you want has already been encoded as U+FFFD before the file gets to Retool then there may not be much else to do Where is the CSV coming from originally @mondob?
Hi @Kabirdas, I'm not sure what is the original source of files, they might have been exported from different sources by my client.
When I open the original file I can see it shown normally, the "?" is shown only when uploaded to Retool.
Do I understand right that there is no solution in Retoll right now for such files? The only option would be to resave files manually and then upload them to Retool?
Oh I see, my mistake, I misread the thread. If the "?" isn't present in the CSV and the only issue you're having is how to incorporate Anson's script into your original code then it should be doable.
Does the code you posted work? Or was it already throwing the fileInput1 is not defined error?
If it was working, you might try using something like this to incorporate Anson's solution:
For now, the only option in the fileUtils.parseCSV is the header boolean @AnsonHwang (the docs should be updated to reflect this). As of writing this, it uses Papa Parse under the hood though so you should be able to get very similar functionality using that library directly as you mentioned.