We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a9f9c58 + bc5489e commit 39bb797Copy full SHA for 39bb797
src/Grid/Exporters/CsvExporter.php
@@ -160,7 +160,7 @@ public function export()
160
$response = function () {
161
$handle = fopen('php://output', 'w');
162
$titles = [];
163
-
+ fwrite($handle, chr(0xEF).chr(0xBB).chr(0xBF)); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
164
$this->chunk(function ($collection) use ($handle, &$titles) {
165
Column::setOriginalGridModels($collection);
166
@@ -170,7 +170,7 @@ public function export()
170
$current = $column->fill($current);
171
$this->grid->columnNames[] = $column->getName();
172
});
173
- fwrite($handle, chr(0xEF).chr(0xBB).chr(0xBF)); //导出的CSV文件是无BOM编码UTF-8,而我们通常使用UTF-8编码格式都是有BOM的。所以添加BOM于CSV中
+
174
// Write title
175
if (empty($titles)) {
176
fputcsv($handle, $titles = $this->getVisiableTitles());
0 commit comments