Bug #66431 [NEW]: Special Character via COM Interface (CP_UTF8)

From: Date: Tue, 07 Jan 2014 02:55:47 +0000
Subject: Bug #66431 [NEW]: Special Character via COM Interface (CP_UTF8)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183619@lists.php.net to get a copy of this message
From:             trantruongchinh at gmail dot com
Operating system: window server 2008
PHP version:      5.4Git-2014-01-07 (Git)
Package:          COM related
Bug Type:         Bug
Bug description:Special Character via COM Interface (CP_UTF8)

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 bug report at https://bugs.php.net/bug.php?id=66431&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66431&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66431&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66431&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66431&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66431&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66431&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66431&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66431&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66431&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66431&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66431&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66431&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66431&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66431&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66431&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66431&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66431&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66431&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66431&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66431&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#183619) next »