Bug #66431 [Opn->Asn]: Special Character via COM Interface (CP_UTF8)

From: Date: Thu, 03 Apr 2014 10:14:35 +0000
Subject: Bug #66431 [Opn->Asn]: Special Character via COM Interface (CP_UTF8)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185060@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66431&edit=1

 ID:                 66431
 Updated by:         ab@php.net
 Reported by:        trantruongchinh at gmail dot com
 Summary:            Special Character via COM Interface (CP_UTF8)
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            COM related
 Operating System:   window server 2008
 PHP Version:        5.4Git-2014-01-07 (Git)
-Assigned To:        
+Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2014-01-07 02:55:46] 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  ಧ 殯勋"



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66431&edit=1


Thread (3 messages)

« previous php.bugs (#185060) next »