Вопрос

I'm writing text from database to ODT document table using odtphp, using this http://www.odtphp.com/index.php?i=tutorials&p=tutorial6 example. In generated ODT some international characters are encoded wrong (or not encoded?). There was similar problem with other values, not in segments, that were set using setVar() function, but it was solved using

$odf->setVars($k, $v, true, 'UTF-8');

Looks like there's no additional settings for segment values.

Это было полезно?

Решение

Looks like that all text in segments were encoded to UTF-8 again, even if text has already been in UTF-8. Currently I solved this issue by replacing line 203 in Segment.php from odtphp with following code:

return $this->setVars($meth, $args[0], false, 'UTF-8');
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top