This is a follow-on question from this one: Algorithm to dynamically merge arrays
There are unescaped characters in some of the cells in the spreadsheet. I try to escape them with addslashes() but phpexcel seems to ignore this and stop processing the rest of the rows. I get this error in the logs:
PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1
I've looked through the API; I haven't seen any text formatting methods that I can use. (Please correct me if I'm wrong)
Your help is appreciated.
From the PHP documenation:
"It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script uses different encoding then it is possible to convert the texts with PHP's iconv() function."
Escaping the characters won't do anything, as the characters that are not valid UTF8 characters, will stay invalid.
Although you could do character set conversion when you pass the data to PHPExcel, I'd instead strongly recommend switching your whole project to UTF8 as dealing with multiple character sets in one project is not a good problem to have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With