问题
I'm using Maatwebsite in Laravel and it's very good option for excel works but I have one problem .. I have excel sheet with arabic heading, so when I import it , it converted to understand-less english character to fit array key .. So What is the solution for my problem?
回答1:
I know it's too late, but for someone else that may have the same problem, you should change the value of "heading" key to "original" in "import" array of config/excel.php file..
'import' => [
...
'heading' => 'original',
],
回答2:
http://www.maatwebsite.nl/laravel-excel/docs/import
Look up the header about import encoding.
From thoose pages:
// When utilising a closure, you can pass the input encoding as third parameter.
Excel::load('filename.csv', function($reader) {
}, 'UTF-8');
// or without a closure, you can use it as second parameter.
Excel::load('filename.csv', 'UTF-8');
Does that solve the issue?
回答3:
I'm too late but this workerd for me, instead of a modifying import.php, in your controller add this
config(['excel.import.heading' => 'original' ]);
来源:https://stackoverflow.com/questions/34397671/import-utf-8-headings-maatwebsite-laravel