I have a program in which I am trying to place East Asian characters onto a MS Word document using the MergeBlock method. The text is in an XML file that looks like this:
...
<titleInfo>
<title>詩風初集</title>
</titleInfo>
...
|
1. I've verified the following are all encoded in UTF-8:
-XML file
-MS Word template
-PHP (using the iconv_set_encoding methods)
2. I verified that PHP is extracting the title with the proper characters. I did this by doing a simple echo of the title.
Inside my MS Word template, I have a table with a block that looks like this:
Here is the code I used to try to populate the template:
...
$xml = simplexml_load_string($xmlString);
$TBS = new clsTinyButStrong(); // new instance of TBS
$TBS->setOption("charset", "UTF-8");
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->LoadTemplate($templatePath, "UTF-8");
echo $xml->titleInfo->title; //This echos the characters correctly
$TBS->MergeBlock('a', array(array("title" => $xml->titleInfo->title)));
$TBS->Show(OPENTBS_FILE, $filesName);
|
If I use any characters aside from the East Asian characters, the blocks populate correctly. Using East Asian Characters, the characters are displayed as squares, question marks, and other symbols (something like this: 詩風åé).
I also tried changing the font of the template to Arial Unicode MS but this resulted in the same output as mentioned above.
Any ideas what I'm doing wrong?
Thanks.