Might be this is the cause. The document contains a font that is not installed on your computer, and Word substituted an available font that doesn't include the same symbols and characters available in the original font.
Aug 18, 2017
2
Level 1
Error unicode - Laravel Excel
Hi every body, I have a problem, can you guys help me ?
I use Maatwebsite/Laravel-excel to export japanese text from database to csv file.
When I open export file using MS Excel, I got a lot of symbols. But when I open it using Notepad++ or upload to Google Drive, I got exactly I want.
How can I fix it ?
This is my code :
public function export($type, $properties, $data)
{
if (in_array($type, self::EXPORT_TYPE)) {
try {
$export = Excel::create($properties['_title'], function ($excel) use ($data, $properties) {
$excel->sheet('Sheet', function ($sheet) use ($data) {
foreach ($data as $item) {
$sheet->fromArray($item);
}
});
});
$csvFileExportPath = 'csv/exports';
$resultExport = $export->store($type,storage_path($csvFileExportPath), $file = true, $returnInfo = true);
return $resultExport['file'];
} catch (Exception $error) {
throw $error;
}
}
}
Please or to participate in this conversation.