4

I am trying to read strange characters from a .csv file using Papaparse.

Here is an example of some of the strange characters: ‡,œ,‰,Ž,etc

When I read these with papaparse I get: �,�,�, etc regardless of if printed to console or into a .csv/.txt file.

I've tried setting my papaparse config variable to various encoding types with no success. I would like these characters to stay the same in console print out and when written to file.

ProGirlXOXO
  • 2,170
  • 6
  • 25
  • 47
  • I'm not great with encodings, but it would be helpful if you state what you tried already and what the input is. – Matt Mar 15 '16 at 03:57
  • 1
    Another approach is to review authoring of the CSV file. Saving it to disk with UTF-8 encoding may even solve the problem. – traktor Mar 15 '16 at 04:14
  • @Traktor53 I used Numbers on Mac to resave as .csv in UTF-8. Then all the characters read correctly. Thank you. – ProGirlXOXO Mar 15 '16 at 06:57
  • 1
    Please consider posting an answer including how you needed to configure papaparse encoding or whether it worked by default - personally I have no idea!. You are welcome. – traktor Mar 15 '16 at 21:36

1 Answers1

1

I solved this problem by:

  1. Opening the .csv file in Numbers (OSX)
  2. File > Export to > CSV > Advanced Options > Unicode (UTF-8)
  3. In papaparse config var set encoding: "utf-8"
ProGirlXOXO
  • 2,170
  • 6
  • 25
  • 47