Voting

: max(zero, six)?
(Example: nine)

The Note You're Voting On

encode
2 years ago
Regarding Excel and UTF-16LE encoding

For complete Excel compatibility (umlauts, cyrillic, chinese alphabet etc.) one needs to encode their .csv to UTF-16LE, use tabulators (\t) as the separator and include a UTF-16LE BOM at the start of the file.

This however can not be done by simply encoding the input for putcsv, since separators and enclosure characters will still be written in the default encoding, and fputcsv will not accept utf-16 encoded separator/enclosure characters.

The simple solution is to roll your own implementation of fputcsv with escaping etc., or possibly to encode the generated .csv file after the fact.

<< Back to user notes page

To Top