You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Japanese or Chines language utf-8 not supporting in doc reading example 1 にっぽんこく、にほんこ example 2 監警會決定不在司法覆核裁決前發布首份階段性報告
such kind of languages is not reading in doc format
Steps to Reproduce
function phpReader($source) {
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'MsDoc');
$text = ExtractText($phpWord);
return $txt ;
}
function ExtractText($obj, $nested = 0) {
$txt = "";
if (method_exists($obj, 'getSections')) {
foreach ($obj->getSections() as $section) {
$txt .= " " . ExtractText($section, $nested + 1);
}
} else if (method_exists($obj, 'getElements')) {
foreach ($obj->getElements() as $element) {
$txt .= " " . ExtractText($element, $nested + 1);
}
} else if (method_exists($obj, 'getText')) {
$txt .= $obj->getText();
} else if (method_exists($obj, 'getRows')) {
foreach ($obj->getRows() as $row) {
$txt .= " " . ExtractText($row, $nested + 1);
}
} else if (method_exists($obj, 'getCells')) {
foreach ($obj->getCells() as $cell) {
$txt .= " " . ExtractText($cell, $nested + 1);
}
} else if (get_class($obj) != "PhpOffice\PhpWord\Element\TextBreak") {
$txt .= "(" . get_class($obj) . ")"; # unknown object, you need to add it
}
return $txt;
}
example1 responce is "k0c0}0�0S0 O k { � S " example2 responce is " ãvf��gzl�[ N(WøSÕl��8hÁ �z"
Japanese or Chines language utf-8 not supporting in doc reading
example 1 にっぽんこく、にほんこ
example 2 監警會決定不在司法覆核裁決前發布首份階段性報告
such kind of languages is not reading in doc format
Steps to Reproduce
example1 responce is "k0c0}0�0S0 O k { � S "
example2 responce is " ãvf��gzl�[ N(WøSÕl��8hÁ �z"
$phpWord response in example 2 .
like
` ```
The text was updated successfully, but these errors were encountered: