snuffish Posted August 24, 2009 Share Posted August 24, 2009 Hi, I'm working to generate a excel file with the PHPExcel library. But I got a big problem. The excel file will not open if the file contains the characters "åäö" (that's swedish characters). I got this error after I have generated the file and want to open it: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <logFileName>error021840_01.xml</logFileName> <summary>Errors were detected in file 'C:\DOCUME~1\snuffish\LOKALA~1\Temp\report-46.xlsx'</summary> - <removedParts summary="Following is a list of removed parts:"> <removedPart>Removed Part: /xl/sharedStrings.xml part with XML error. (Strings) Illegal xml character. Line 97, column 26.</removedPart> </removedParts> - <removedRecords summary="Following is a list of removed records:"> <removedRecord>Removed Records: Cell information from /xl/worksheets/sheet1.xml part</removedRecord> <removedRecord>Removed Records: Cell information from /xl/worksheets/sheet2.xml part</removedRecord> </removedRecords> </recoveryLog> But the problem is that the error only appears when I receive a string form the MySql database that contains those characters. It's work perfectly when I write words directly in the source. I have tried to change all types of encoding (UTF-8/ANSI etc..) but nothing works and I have searched through the whole web. But I can't find the answer. So I would be very glad if anyone could help me as soon as possible. // Best regards Christoffer! Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted August 24, 2009 Share Posted August 24, 2009 You need to make sure that the text you set in the cells is UTF-8. If your database is returning data using a different charset, then you'll need to use iconv() to convert it to UTF-8 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.