Character encoding issues when reading XLS files with PHP
I am using PHP-Excel-Reader library to read some XLS files and immediately got into this problem:
PHP Note:
iconv()
[function.iconv]: An incomplete multibyte character was encountered in the input line at C: \ web \ docs \ housing \ excel_reader2.php at line 1718
The relevant line is:
$result = iconv('UTF-16LE', $this->_defaultEncoding, $string);
And I've added some debug info to help diagnose the problem:
var_dump($string); // string(10) "A r i a l "
echo bin2hex($string) . "\n"; // 41007200690061006c00
echo $this->_defaultEncoding . "\n"; // UTF-8
I tried to switch to _defaultEncoding
any number of random encodings, but obviously it didn't help.
If anyone has any hints please help!
+2
source to share
3 answers