How do I export a CSV file in MS-DOS format?

Topics: Developer Forum, User Forum
Feb 25, 2014 at 9:24 AM
First of some of the required information:

PHPExcel version: 1.7.7.
PHP version on server: 5.3.3-7+squeeze15.

I want to generate a CSV file so it's encoded in MS-DOS. I have the following code that generates the file:
$excel_writer = new PHPExcel_Writer_CSV($this->_excel);

$excel_writer->setDelimiter(';');

$excel_writer->save($this->_upload_path.$filename);
I don't know what i can do to tell PHPExcel to generate a CSV file in MS-DOS format. Any help would be appreciated!
Coordinator
Feb 25, 2014 at 11:12 AM
Perhaps you could start by explaining to me what MS-DOS format is. As far as I'm aware, MS-DOS is an old operating system, not a format for CSV files which aren't restricted to a single operating system. What is different about an MS-DOS format CSV file that isn't standard for other CSV format files?
Feb 25, 2014 at 11:34 AM
The problem is that the client we are sending these files to has to open them and then save them as CSV (MS-DOS). This option is available in excel so it's a valid format. I'm still figuring out what the real difference is between CSV (MS-DOS) and "normal" CSV files.

First I thought it had something to do with delimiters and line endings but after reading this article I'm not that sure anymore. Looks like you're right and this is only used by old DOS based operating systems.

In the article encoding is mentioned as the real difference. Maybe there lies the solution? Not sure if there's a way to set this type of encoding to the CSV file I'm generating with PHPExcel?