|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-07-22 03:48 UTC] tuugii83 at gmail dot com
Description:
------------
Mongolian string creating the COM string with junk bytes at the end.
xammp v3.2.1
PHP Version 5.5.11
Test script:
---------------
MySourceCode :
..........
$word = new COM("word.application", NULL, CP_UTF8) or die("Unable to start Word");
$template_file = "template.doc";
$word->visible=1;
$word->Documents->Open($template_file);
$BkMark = $word->ActiveDocument->Bookmarks("NAME");
$range = $BkMark->Range;
$range->Text = "ХҮДЭРБАТ";
$word->Documents[1]->SaveAs($template_file);
$word = null;
..........
Expected result:
----------------
ХҮДЭРБАТ
Actual result:
--------------
ХҮДЭРБАТ ফ ୩
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Using the following variant of the supplied test script, I get the expected results. <?php $word = new COM("word.application", NULL, CP_UTF8); $word->visible=1; $doc = $word->Documents->Add(); $range = $doc->Range(); $range->Text = 'ХҮДЭРБАТ'; ?> Can you still reproduce the reported bug with any of the actively supported PHP versions[1]? [1] <https://www.php.net/supported-versions.php>