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()
160160 $ response = function () {
161161 $ handle = fopen ('php://output ' , 'w ' );
162162 $ titles = [];
163-
163+ fwrite ( $ handle , chr ( 0xEF ). chr ( 0xBB ). chr ( 0xBF )); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
164164 $ this ->chunk (function ($ collection ) use ($ handle , &$ titles ) {
165165 Column::setOriginalGridModels ($ collection );
166166
@@ -170,7 +170,7 @@ public function export()
170170 $ current = $ column ->fill ($ current );
171171 $ this ->grid ->columnNames [] = $ column ->getName ();
172172 });
173- fwrite ( $ handle , chr ( 0xEF ). chr ( 0xBB ). chr ( 0xBF )); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
173+
174174 // Write title
175175 if (empty ($ titles )) {
176176 fputcsv ($ handle , $ titles = $ this ->getVisiableTitles ());
You can’t perform that action at this time.
0 commit comments