Skip to content

Commit

Permalink
set use bom for csv file (#844)
Browse files Browse the repository at this point in the history
* add set useBom config

* add set use bom for csv file
  • Loading branch information
rayjun authored and patrickbrouwers committed Jul 9, 2016
1 parent 48a4434 commit c6ab521
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Maatwebsite/Excel/Writers/LaravelExcelWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ protected function _setWriter()
$this->writer->setDelimiter(Config::get('excel.csv.delimiter', ','));
$this->writer->setEnclosure(Config::get('excel.csv.enclosure', '"'));
$this->writer->setLineEnding(Config::get('excel::csv.line_ending', "\r\n"));
$this->writer->setUseBOM(Config::get('excel.csv.use_bom', false));
}

// Set CSV delimiter
Expand Down
10 changes: 9 additions & 1 deletion src/config/excel.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,15 @@
|--------------------------------------------------------------------------
*/

'line_ending' => "\r\n"
'line_ending' => "\r\n",

/*
|--------------------------------------------------------------------------
| setUseBom
|--------------------------------------------------------------------------
*/

'use_bom' => false
),

'export' => array(
Expand Down

0 comments on commit c6ab521

Please sign in to comment.