2

Excel_reader.php:

function _encodeUTF16($string) {
$result = $string;
    if ($this->_defaultEncoding){
        switch ($this->_encoderFunction){
            case 'iconv' :   $result = iconv('UTF-16LE', $this->_defaultEncoding, $string);
                            break;
            case 'mb_convert_encoding' :     $result = mb_convert_encoding($string, $this->_defaultEncoding, 'UTF-16LE' );
                            break;
        }
    }
return $result;

The notice showing on this line:

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

I replaced this line with this also

iconv('UTF-8', "ISO-8859-1//IGNORE", $string);

The notice got removed but my excel sheet not got imported.

My excel sheet is not getting imported now, it was working fine until someday before. & It does work in localhost but not in server. How can i import my excel sheet again ??

Pooojaaaa
  • 183
  • 1
  • 4
  • 16
  • What do you mean by "is not getting imported"? Are there any errors or just missing or false data? How does the Excel file get to the server? By upload? Did you check if the uploaded Excel file is still valid, that is, can it still be opened by Excel? – Quagaar Dec 29 '16 at 11:43
  • My excel file got imported to database.. It was working fine also.. but now it's showing this notice.. – Pooojaaaa Dec 29 '16 at 11:48
  • You said that the notice was gone after you changed the `iconv` line but that the import still didn't work. So my question was: what does "not got imported" mean after the notice was gone. Also, you didn't answer all questions I wrote in my comment. – Quagaar Dec 29 '16 at 12:12
  • i upload the excel file.. My excel file does not get imported to database. The excel file is valid and working in localhost – Pooojaaaa Dec 29 '16 at 12:27
  • Do you have access to the server? Can you get the uploaded file, compare it with the original file and check if it can still be opened with Excel on your machine? – Quagaar Dec 29 '16 at 13:18

1 Answers1

0

I simply changed it to this:

case 'iconv' :   $result = iconv('UTF-8', $this->_defaultEncoding, $string);

and it works.

weera
  • 884
  • 1
  • 10
  • 21