odtphp 段中的编码问题
我正在使用 odtphp 将文本从数据库写入 ODT 文档表,使用此 http ://www.odtphp.com/index.php?i=tutorials&p=tutorial6 示例。在生成的 ODT 中,某些国际字符编码错误(或未编码?)。使用 setVar() 函数设置的其他值(不在段中)也存在类似问题,但已使用 解决
$odf->setVars($k, $v, true, 'UTF-8');
看起来没有针对段值的其他设置。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来段中的所有文本都再次编码为 UTF-8,即使文本已经采用 UTF-8。
目前,我通过用以下代码替换 odtphp 中 Segment.php 中的第 203 行解决了这个问题:
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: