You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2019. It is now read-only.
When trying to read a UTF-16LE CSV file I encounter the error:
Notice: iconv(): Detected an incomplete multibyte character in input string in phpoffice/phpexcel/Classes/PHPExcel/Shared/String.php
After doing some digging it's because fgetCSV isn't paying attention to the fact that the file is UTF-16 and is splitting the file after the first byte of the commas.
Using "Cell1,Cell2" as sample data in the example below and [] to show where each 2 byte segment is, spaces for null bytes.
So [C ][e ][l ][l ][1 ][, ][C ][e ][l ][l ][2 ] gets split into "[C ][e ][l ][l ][1 ][," and " ][C ][e ][l ][l ][2 ]". Notice how when we try to convert the second cell we will be passing a string that will be read as "[ C][ e][ l][ l]" - hence the invalid character [ C].
A suggested solution is to set the locale to UTF-16; this doesn't work for me.