Monday 15 July 2013

Sending Cyrillic characters to Word with PHP and COM Object -


I am creating a PHP application for which to create a Word document through the COM object, I entered Most of the required functions have been found by checking the code of the test macros, but I still can not find the way to write the passage of Cyrillic characters. I am trying the following:

  $ word-> select-> Tippax (Variable) (10 9) & ChrW (1085) & ChrW (1080p) & amp; ChrW (1074) & amp; ; ChrW (1077) and Krisve (1088) and PRW (10 9 8) and PRW (1080) and PRW (1090) and PRW (1077) and PRW (1090));   

I am getting the following error:

Fatal error: C: \ xampp \ htdocs \ xampp \ COM \ Unfortunately, for COM objects Especially can not find any documents for PHP, so I hope with my question that someone can help me. $ wordApp = new COM ("word.application", null, CP_UTF8); // & lt; - Codepap CP_UTF8 // Important to specify open document ... ... $ text = "Characters with macrons: Ā ā Ē ē Ī ī Ō ō Ū ū"; // UTF-8 string $ word app- & gt; Selection-> TypeTest ($ text); ...

The third parameter for COM is CodePep and it specifies which conversion is used on the string passed from the COM object . By specifying CP_UTF8 , I am telling COM that all the strings I would pass (like $ text in $ wordApp>>> select-> gt; ; Type-test ($ text); ) will be encoded using UTF-8 and all the strings I receive, I should encode using UTF-8. If you do not specify codepeps, the default is used, probably Windows-1252 (Western).

For more information see here :.

No comments:

Post a Comment