benwinding / react-admin-import-csv

A csv file import button for react-admin

Home Page:https://benwinding.github.io/react-admin-import-csv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change encoding

vahidqo opened this issue · comments

Hi friends
When I import a CSV file that contains Persian letters, the letters will be converted to "????". I think the problem is in encoding.
I want to change the CSV encoding when uploading a file. How can I do this?

Yeah interesting, you should be able to pass in the encoding string value to the papaparse options like this:

const importOptions = {
  parseConfig?: {
    encoding: 'ISO-8859-1'
  }
}

For all parseConfig options see: https://www.papaparse.com/docs#config