Quantcast
Channel: Is it possible to force Excel recognize UTF-8 CSV files automatically? - Stack Overflow
Viewing all articles
Browse latest Browse all 35

Answer by Ixtlilton for Is it possible to force Excel recognize UTF-8 CSV files automatically?

$
0
0

Had the same problems with PHP-generated CSV files. Excel ignored the BOM when the Separator was defined via "sep=,\n" at the beginning of the content (but of course after the BOM).

So adding a BOM ("\xEF\xBB\xBF") at the beginning of the content and setting the semicolon as separator via fputcsv($fh, $data_array, ";"); does the trick.


Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>