Having problem reading from XLS file (Cyrillic, russian chars)

Topics: Developer Forum, User Forum
Jul 23, 2010 at 6:49 PM
Edited Jul 23, 2010 at 6:50 PM

Hi all !

I'm trying to read russian text from xls file and end up with comething like this:


I'm fighting this problem for a week and just can't find the answer. I've searched here, and found nothing.

Can you help me, or just give me a clue where i should search for information or what i should read to be able to resolve the problem ?


Windows XP

Apache 2.0.55

php 5.2.1

PHPExcel 1.7.3

I have mbstring extension turned on

Using next code:


require_once ("lib\PHPExcel\IOFactory.php");
$objReader = PHPExcel_IOFactory::createReaderForFile($filename);
$objPHPExcel = $objReader->load($filename);
$aSheet = $objPHPExcel->getActiveSheet();
foreach ( $aSheet->getRowIterator() as $row )
    $cellIterator = $row->getCellIterator();
    foreach($cellIterator as $key => $cell)
        switch ($key)
              case 0: echo $cell->getValue();
              case 1: echo $cell->getValue();
              case 2: echo $cell->getValue();


Something like this.

Can anyone help me ?

P.S. Sorry for bad English.

              case 0:
Jul 25, 2010 at 12:01 PM

Ensure that you're trying to display the cell content in a UTF-8 page, or use iconv() to convert from UTF-8 to whatever page encoding you're using

Jul 25, 2010 at 1:28 PM
Edited Jul 25, 2010 at 5:46 PM
yes, i'm sure it's a UTF-8 page. one interesting observation: I'm trying to read different xls-files, and from one i get good results (russian letters are readed fine), but from another - i get bad results with text something like i posted earlier. Maybe it will help you help me... i need it, i need it very much.