S
S
Sergey Khlopov2017-12-10 16:12:08
phpspreadsheet
Sergey Khlopov, 2017-12-10 16:12:08

How to fix encoding in PHPExcel?

Hello, tell me please. I have a string with the name of the Excel file name, I clear it of quotes and replace the spaces with "_", display it on the screen, everything is displayed as it should be like this: "OOO_Meruriy_101217.xls", but after generating the file name in a broken encoding "ООО_Мерурий_121017.xls", I use PHPExcel library, please tell me how can I fix it? Thank you in advance.

$objWriter = new PHPExcel_Writer_Excel5($xls);
   $fileTemp = $renderable['_Own']['#value']."_".date("dmy").".xls";
   $fileTemp2 = preg_replace('/\s+/u', '_', $fileTemp);
   $filName = preg_replace('/\"/u', '', $fileTemp2);
   echo $filName;
   $objWriter->save('sites/default/Excelfille/'."$filName");

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Osadchy, 2017-12-10
@Shlop

iconv?

D
Dimonchik, 2017-12-10
@dimonchik2013

well, you still need to learn about encoding and utf8,
start with file names in Latin - it will be easier to understand

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question