Forum


Replies: 5   Views: 3744
™ symbol crash
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 07-03-2016 - 08:05

Hello,

We have done some tests and everything seem working fine. If we run this code:

<?php

require_once 'classes/CreateDocx.inc';

$docx = new CreateDocxFromTemplate('TemplateWordFragment_1.docx');

$wf = new WordFragment($docx, 'document');

$valuesTable = array(
    array(
        'AAA',
        'BBB',
    ),
    array(
        'Text',
        'Text: ™ More text'
    ),

);

$paramsTable = array(
    'border' => 'single',
    'tableAlign' => 'center',
    'borderWidth' => 10,
    'borderColor' => 'B70000',
    'textProperties' => array('bold' => true),
);

$wf->addTable($valuesTable, $paramsTable);

$docx->replaceVariableByWordFragment(array('WORDFRAGMENT' => $wf), array('type' => 'block'));

$docx->createDocx('output');

That includes a ™ symbol, phpdocx outputs a DOCX without error and this document can be opened perfectly with MS Word.

Please run this simple sample and check if your file has UTF8 encoding. If you still have this issue please send to contact[at]phpdocx.com a whole script (the simplest script that illustrate the issue without doing external connections such as databases or web services) and the DOCX document you get after running the PHP code.

Regards.