Glyphs and German umlauts

Topics: User Forum
Feb 23, 2014 at 2:27 PM
Hi there,

I am just trying out your PHPExcel tool and am having some issues with german umlauts like 'ü', 'ä','ö', etc. special characters like '€' are not working either.

My code:
$phpExcel = new PHPExcel();

$phpExcel->getActiveSheet()->setCellValue('A1', 'abcüAndSoOn);
$objWriter = PHPExcel_IOFactory::createWriter($phpExcel, 'Excel5');
Everything works fine but when i open the generated .xls file cell A1 just contains abc without the rest üAndSoOn. It doesn't matter if i write this string in the editor or loading it from a data base table.

What am i missing?

Thanks in advance.
Feb 23, 2014 at 3:42 PM
Always use UTF-8 when setting values in cells
Feb 23, 2014 at 5:21 PM
OK thanks.
I simply used:
$str = 'abcüAndSoOn';
$str = mb_convert_encoding($str, "UTF-8"); //mb_convert_encoding is from PHP
And it worked perfectly.

Thanks a lot.