|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-05 12:22 UTC] wharmby@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Description: ------------ I try to test this bug with the MS Word application, with MS Excel and with Adobe Indesign application, but I suppose that also with other applications the result is the same. If I insert (with COM interface) a text with non standard encoding (like russian language , greek language etc.), I get always strange output. I try to change all the settings in php.ini, I try to use the mbstring and the iconv functions, but the result is the same: 1) I get the '?' symbols 2) I get the strange output The file .php that I use for test is saved correctly in utf-8 format I.E. I put a greek text in a variable..if I write this variable in a text file, it work well, but If I use this var for print an output with a com interface, it doesn't work. I try this with all the last php versions. Reproduce code: --------------- <? // create a reference to a new COM component (Word) $word = new COM("word.application") or die("Can't start Word!"); // print the version of Word that's now in use echo "Loading Word, v. {$word->Version}<br>"; // set the visibility of the application to 0 (false) // to open the application in the forefront, use 1 (true) $word->Visible = 1; // create a new document in Word $word->Documents->Add(); // add text to the new document //in the next line I assign at $text var a greek text string $text="????????"; //i try to use the mb, with many combinations of encoding //but the result is the same if I comment this line $text=mb_convert_encoding($text, '', "UTF-8"); //I try to write the var in a text file, and it works well $c=fopen("test.txt","w"); fputs($c,($text)); $word->Selection->TypeText($text); //save the document in the Windows temp directory // print another message to the screen echo "Check for the file..."; ?>