PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

MsDoc(*.doc) cyrillic symbols

Open ScriptedEngineer opened this issue 5 years ago • 1 comments

Describe the Bug

*.doc (MsDoc) cyrillic symbols reading is not working correctly image

Steps to Reproduce

1.Create MsDoc(*.doc) file with cyrillic symbols 2.Run this code

<?
require __DIR__ . '/vendor/autoload.php';
$phpDoc = \PhpOffice\PhpWord\IOFactory::load("FileName.doc", 'MsDoc');
$body = "";
foreach ($phpDoc->getSections() as $sections) {
  foreach ($sections->getElements() as $el) {
    if($el instanceof PhpOffice\PhpWord\Element\Text){//
      $body .= $el->getText();
    }
  }
}
echo($body);

Expected Behavior

Normal text

Current Behavior

image

Context

  • PHP Version: 5.6
  • PHPWord Version: 0.17.0

ScriptedEngineer avatar Sep 03 '20 18:09 ScriptedEngineer

@ScriptedEngineer Hi, Could you send me a file with this case, please, for analysis ?

Progi1984 avatar Aug 22 '24 16:08 Progi1984

@ScriptedEngineer

This issue has been fixed by a maintainer in the PR #2664. You can help him by sponsoring him through Github sponsors.

Progi1984 avatar Aug 30 '24 11:08 Progi1984