B
B
Banzeg2012-02-06 22:24:20
ASCII
Banzeg, 2012-02-06 22:24:20

PHP Excel. Problem with encoding Russian characters

There was an encoding problem. When reading from cells, $cell->getValue() returns an ASCII string, so question marks appear where Cyrillic was. Since dancing with locales and recoding the resulting string does not give a result, the question is: where and what to twist in PHPExcel itself?

PS: I'm not special in PHP or in encodings, please treat the question indulgently.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Banzeg, 2012-02-07
@Banzeg

the question is removed, the root is in the encoding of the document :)

D
DigitallParts, 2017-02-19
@DigitalParts

With a file in Excel95 format (specifically, in the case of the created 1c 7.7), the problem is solved as it turned out in an elementary way :)
echo iconv('cp1251','utf-8', iconv('',"latin1", $text));

A
Alter_Ego, 2012-02-06
@Alter_Ego

Try this
$validLocale = PHPExcel_Settings::setLocale('ru');
before creating the object
$objReader = new PHPExcel_Reader_Excel5();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question