While I am downloading csv file in my laravel project, the file name which is in japanese is printed like ___.csv.
This is the file download part
$currentDate = Carbon::now()->format('Ymd');
$fileName = '【' . $selectedCategory->title . '】' . $headquarterName->title . '_' . $currentDate . '_虎の巻利用状況.csv';
$filePath = storage_path('app/'.$fileName);
// csv download
$csvFile = fopen(storage_path('app/' . $fileName), 'w');
$bom = chr(239) . chr(187) . chr(191);
fwrite($csvFile, $bom);
header('Content-Type: text/csv; charset=UTF-8');
fputcsv($csvFile, $this->getHeaderRow($contents));
foreach ($contents as $data) {
$dataRow = $this->getDataRow($data);
$this->customFputcsv($csvFile, $dataRow);
}
fclose($csvFile);
return Response::download($filePath, $fileName);
This is file name is storage
file stored in storage
And this is the file which is downloaded in my device:
file downloaded in my device
Here we can see that japanese charecters are printed like ____
I need solution from here.