Search code examples
javascriptpapaparse

Papaparse proper encoding for strange characters


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.


Solution

  • 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"