Alex Rivera | Logout

What is "ANSI as UTF-8" and how can I make fputcsv() generate UTF-8 w/BOM?

Asked 2009-09-04T17:57:12.003
19

I made a PHP script that generates CSV files that were previously generated by another process. And then, the CSV files have to be imported by yet another process.

The import of the old CSV files works fine, but but when importing the new CSV files there are issues with special characters.

When I open old CSVs with Notepad++, it says the encoding is UTF-8, and when I open the new CSVs with it, it says their encoding is 'ANSI as UTF-8'.

What's the difference of the two?

And how can I make fopen and fputcsv use the 'pure?' UTF-8 encoding?

Thanks!

Edit
Report

1 Answer

1

Try changing your PHP script to UTF-8 too. Sometimes it is necessary (despite it can be bypassed) to have the script in the same char encoding of the data.

Similar problem: PHP: Explode using special characters

answered 2009-09-04T18:04:14.250

Your Answer