使用 League/CSV 导出 CSV 不会对 umlauts 进行编码

我正在导出一个模型在拉拉维尔 5.7, 使用League/csv [https://csv.thephpleague.com]包: public function export(Request $request) { $people = Person::all(); $location = 'export.csv'; $csv = Writer::createFromPath($location, 'w'); $csv->setOutputBOM(Writer::BOM_UTF8); $csv->setDelimiter(';'); foreach ($people as $person) { $csv->insertOne($this->serializePerson($person)); } return response($location); } protected function serializePerson($person) { return [ $person->name, ……

共1个回答,已解决, 标签: php laravel csv utf-8 byte-order-mark