Came across an interesting and frustrating issue last week. A client was exporting selected data from a WordPress database (actually using this plugin), and the user was seeing odd characters in the csv output. The most obvious was the replacement of single apostrophes: ‘ with this: ’.
Clearly an encoding problem but I couldn’t immediately see why. Pages displaying the data were fine, web pages and the database were all set to use utf-8
. I finally solved the problem by forcing the encoding of the csv file via:
$text = mb_convert_encoding($text,'windows-1252');
Hope this helps someone else…
Hi Tom
I think in this case I edited the plugin that was creating the export directly to force the encoding.
Regards
Simon
Hi Simon,
Thanks for posting about this problem – I’ve been searching but can’t find any solution to my .csv encoding troubles.
Would you be able to let me know where you added this code – child theme functions file?
Any advice much appreciated!
Thanks,
Tom