2

I'm using the PHP-Excel-Reader library to read some XLS files and immediately have hit this issue:

PHP Notice: iconv() [function.iconv]: Detected an incomplete multibyte character in input string in C:\web\docs\housing\excel_reader2.php on line 1718

The line in question is this:

$result = iconv('UTF-16LE', $this->_defaultEncoding, $string); 

And I've added some debugging info before that 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've tried changing to the _defaultEncoding to any number of random charsets but it obviously hasn't helped.

If anyone has any clues, please do help!

    3 Answers 3

    3

    I realize this is an old post, but one thing to check is if there are any links in your excel file. I ran in to the exact same issue and it was solved by removing any hyperlinks from the excel file.

    2
    • I've got the same problem. Removed the hyperlinks and everything was OK.CommentedApr 3, 2011 at 13:01
    • how to remove hyperlinks?
      – Muhammad
      CommentedSep 26, 2013 at 6:08
    1

    since it is a warning you may ignore it try this:

    $result = @iconv('UTF-16LE', $this->_defaultEncoding, $string);

      0

      try :

      $result = iconv('UTF-16LE', $this->_defaultEncoding . "//IGNORE", $string); 
      1
      • can you give an example of your xls file
        – Bader
        CommentedSep 24, 2009 at 12:18

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.