Forum


Replies: 7   Views: 3536
Problems replacing the first variable
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 lotveito  · 28-11-2016 - 11:18

My findings:

  • My php file is UTF8 encoded. And it has the three things in the start to signal that it is UTF8. I tried to remove these but it made no difference. I then made the phpscript again from scratch in another text-editor. No difference. (First text editor: NetBeans, Second text editor: UltraEdit)
  • I can easily put norwegian characters (å, ø, æ) in my php code, and replace the variables in the templates with norwegian text that includes these characters. This works beautifully.
  • But whenever there are one or more norwegian characters somewhere in the template word-file the first replacement fails.
  • The template is made in Word 2016. From Word I tried to save the template as "Strict open XML-document (*.docx)" but it made no difference.
  • Originally I did not have tidy intalled. I have installed tidy, and it made no difference.

Here is the info from check.php:

PHP_VERSION: 5.3.3-7+squeeze19
PHP_OS: Linux
PHP_UNAME: Linux bhtserver 2.6.32-5-686 #1 SMP Tue May 13 16:33:32 UTC 2014 i686
SERVER_NAME: mgyq.time.bedriftshelsen.no
SERVER_SOFTWARE: Apache/2.2.16 (Debian)
SERVER_ADDR: 192.168.15.51
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: mgyq.time.bedriftshelsen.no
HTTP_X_FORWARDED_FOR: 
PHP_SELF: /test/phpdocx/check.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1

---------------
I am now about to give up...