#31327 [NEW]: chinese char and word problem

From: Date: Tue, 28 Dec 2004 19:46:50 +0000
Subject: #31327 [NEW]: chinese char and word problem
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71172@lists.php.net to get a copy of this message
From:             vtsuper1 at mail dot hongkong dot com
Operating system: windowXP
PHP version:      5.0.3
PHP Bug Type:     COM related
Bug description:  chinese char and word problem

Description:
------------
I have try this code in 
php 5.0.3 and 4.3
I'm using Chinese winXP and Chinese Office XP
apache 2

both version of php also have the same problem
When I use Chinese character in the string, the output of the word file
will have some meaningless spaces after the words I expected(my expected
string is ok, no problem).  There are no problem if I using English. And
this problem will not occurs in excel.

Reproduce code:
---------------
<?php
// starting word
$word = new COM("word.application") or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";

//bring it to front
$word->Visible = 1;

//open an empty document
$word->Documents->Add();

//do some weird stuff
$word->Selection->TypeText("§A¦n¶Ü");
$word->Documents[1]->SaveAs("Useless test.doc");

//closing word
$word->Quit();

//free the object
$word = null;
?> 

Expected result:
----------------
§A¦n¶Ü

Actual result:
--------------
§A¦n¶Ü____

(there are some spaces occurs, I use the underline to repersent the
spaces)

-- 
Edit bug report at http://bugs.php.net/?id=31327&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31327&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31327&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31327&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31327&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31327&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31327&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31327&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31327&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31327&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31327&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=31327&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=31327&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31327&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31327&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31327&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31327&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31327&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31327&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31327&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31327&r=mysqlcfg


Thread (17 messages)

« previous php.bugs (#71172) next »