File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ public function export()
160
160
$ response = function () {
161
161
$ handle = fopen ('php://output ' , 'w ' );
162
162
$ titles = [];
163
-
163
+ fwrite ( $ handle , chr ( 0xEF ). chr ( 0xBB ). chr ( 0xBF )); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
164
164
$ this ->chunk (function ($ collection ) use ($ handle , &$ titles ) {
165
165
Column::setOriginalGridModels ($ collection );
166
166
@@ -170,7 +170,7 @@ public function export()
170
170
$ current = $ column ->fill ($ current );
171
171
$ this ->grid ->columnNames [] = $ column ->getName ();
172
172
});
173
- fwrite ( $ handle , chr ( 0xEF ). chr ( 0xBB ). chr ( 0xBF )); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
173
+
174
174
// Write title
175
175
if (empty ($ titles )) {
176
176
fputcsv ($ handle , $ titles = $ this ->getVisiableTitles ());
You can’t perform that action at this time.
0 commit comments