I'm using fopen to read in a csv and fgetcsv to read the csv lines. The csv is encoded as Windows-1252, how do I convert this to UTF-8 so it doesn't cut lines with none standard characters?
So far I've tried the following:
setlocale(LC_ALL, 'en_GB.UTF-8');
and
drupal_convert_to_utf8($csv_line[3], 'Windows-1251'); // (I'm using Drupal 6.16)
Both seem to fail.
you can use iconv for this kind of work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With