Umlauts compromise XML

Topics: Developer Forum, User Forum
Apr 25, 2008 at 2:45 PM

I have a problem with german umlauts like ä, ö and ü.
E.g. if I use this code:

$objPHPExcel->getActiveSheet()->setCellValue('A3', 'Währung:');

I get the error message "Eccel found unreadable content in test.xlsx", when I try to open the Excel file.
The /xl/sharedStrings.xml contains an xml-error, because the Umlauts are not escaped:


Usually I'd use CDATA for XML-files, but I don't think if this is possible in spreadsheets. Does PHPExcel provide some kind of escaping method?

Apr 28, 2008 at 6:21 AM
Can you try using iconv() or utf8_encode() on this?
Apr 28, 2008 at 7:50 AM
Ah thanks, you were right, my script was in latin-1. utf8_encode() did the trick. :)