我正在尝试使用PHPWord创建一个word文档,其中包含从MySQL数据库中提取的动态数据.数据库有MySQL字符集:UTF-8 Unicode(utf8)MySQL连接校对:utf8_unicode_ci表字段也是如此.
数据以HTML格式存储和预览,但是在使用阿拉伯语变量创建文档时,Word中的输出看起来像Ø£ØÙد ÙØ¨Ø§Ø±Ù اÙÙØ±Ù.
$PHPWord = new PHPWord();
$document = $PHPWord->loadTemplate('templates/.../wtvr.docx');
$document->setValue('name', $name);
$document->setValue('overall_percent_100', $overall_percent_100);
$document->save('Individual Report - ' . $name . '.docx');
Run Code Online (Sandbox Code Playgroud)
反正有没有解决这个问题?