Bug #14353 Updated: can't set CP_UTF8 codepage
| From: | derick@php.net | Date: | Thu, 25 Apr 2002 06:38:19 +0000 |
| Subject: | Bug #14353 Updated: can't set CP_UTF8 codepage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5932@lists.php.net to get a copy of this message | ||
ID: 14353
Updated by: derick@php.net
Reported By: msisolak@yahoo.com
-Status: Open
+Status: Closed
Bug Type: COM related
Operating System: Windows 2000
PHP Version: 4.2.0
New Comment:
Fixed in CVS
Previous Comments:
------------------------------------------------------------------------
[2002-04-23 11:22:25] msisolak@yahoo.com
This is still an issue in 4.2.0.
------------------------------------------------------------------------
[2001-12-06 12:24:31] phanto@php.net
i'll review this
------------------------------------------------------------------------
[2001-12-05 18:18:23] msisolak@yahoo.com
A call to create a COM object can pass the codepage as the third
parameter and CP_UTF8 is a valid option. If you use this, however, the
object create fails.
The problem is in the php_char_to_OLECHAR and php_OLECHAR_to_char
functions in com\conversion.c. MSDN states that a call to
WideCharToMultiByte with a codepage of CP_UTF8 must have a second
parameter is 0, but these functions don't account for that.
How I fixed it (there may be a better way, but it works for me):
lines 764 and 760: change "MB_PRECOMPOSED | MB_ERR_INVALID_CHARS" to
"codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS"
lines 784 and 790: change "WC_COMPOSITECHECK" to "codepage == CP_UTF8 ?
0 : WC_COMPOSITECHECK"
This fix is not well debugged, but it got me moving forward again.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14353&edit=1