php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66431 Special Character via COM Interface (CP_UTF8)
Submitted: 2014-01-07 02:55 UTC Modified: 2014-04-03 10:14 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: trantruongchinh at gmail dot com Assigned: ab (profile)
Status: Closed Package: COM related
PHP Version: 5.4Git-2014-01-07 (Git) OS: window server 2008
Private report: No CVE-ID: None
 [2014-01-07 02:55 UTC] trantruongchinh at gmail dot com
Description:
------------
We automate MS Word 2003 via PHP (5.4.16) COM DOT NET feature directly. We successfully put Vietnamese text into Word Document but This Word Document containt some special characters.

Test script:
---------------
com_load_typelib('Word.Application');
$Wrd = new COM("word.application", NULL, CP_UTF8); 
$Wrd->Application->Visible = 1;
$Wrd->Documents->Add();
$DocName = "temp.docx";
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); 
$text= "Xin chào cộng đồng PHP"; 	
$Wrd->Selection->TypeText($text); 
$Wrd->ActiveDocument->SaveAs($strPath."/".$DocName);
$Wrd->ActiveDocument->Close(false);
$Wrd->Application->Quit();
$Wrd = null;	

Expected result:
----------------
This is word document content 
"Xin chào cộng đồng PHP  ಧ 殯勋"


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-03 10:14 UTC] ab@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: ab
 [2014-04-03 10:14 UTC] ab@php.net
Confirmed, additionally i've this crash on MSHUTDOWN in debug build, but not sure it's the cause. 

 	combase.dll!CStdIdentity::CInternalUnk::Release(void)	Unknown
>	php_com_dotnet.dll!php_com_typelibrary_dtor(void * pDest) Line 229	C
 	php5_debug.dll!zend_hash_destroy(_hashtable * ht) Line 521	C
 	php5_debug.dll!zend_ts_hash_destroy(_zend_ts_hashtable * ht) Line 86	C
 	php_com_dotnet.dll!zm_shutdown_com_dotnet(int type, int module_number) Line 465	C
 	php5_debug.dll!module_destructor(_zend_module_entry * module) Line 2380	C
 	php5_debug.dll!i_zend_hash_bucket_delete(_hashtable * ht, bucket * p) Line 178	C
 	php5_debug.dll!zend_hash_bucket_delete(_hashtable * ht, bucket * p) Line 187	C
 	php5_debug.dll!zend_hash_graceful_reverse_destroy(_hashtable * ht) Line 585	C
 	php5_debug.dll!zend_destroy_modules() Line 1895	C
 	php5_debug.dll!zend_shutdown() Line 827	C
 	php5_debug.dll!php_module_shutdown() Line 2465	C
 	php.exe!main(int argc, char * * argv) Line 1395	C
 	php.exe!__tmainCRTStartup() Line 536	C
 	php.exe!mainCRTStartup() Line 377	C
 [2014-04-29 11:48 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 [2014-04-29 11:48 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2014-04-29 21:50 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 [2014-04-29 21:54 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 [2014-05-01 14:59 UTC] tyrael@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 [2014-10-07 23:15 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 [2014-10-07 23:26 UTC] stas@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=2d625b5f81205d7f0217243b0bfe9a77683951e8
Log: Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC