WG: PHP 4.0 Bug #7155 solved
| From: | Harald Radi | Date: | Fri, 29 Dec 2000 00:49:08 +0000 |
| Subject: | WG: PHP 4.0 Bug #7155 solved | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42497@lists.php.net to get a copy of this message | ||
hi again,
i fixed a few mistakes i missed in the last build. sorry for that.
replace the php_OLECHAR_to_char from the previous file with the
following.
regards
harald
__________________________________________
char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int
persistent)
{
char *C_str;
uint length = 0;
//request needed buffersize
uint reqSize = WideCharToMultiByte(CP, WC_COMPOSITECHECK, unicode_str, -1,
NULL, 0, NULL, NULL);
if(reqSize)
{
C_str = (char *) pemalloc(sizeof(char) * reqSize, persistent);
//convert string
length = WideCharToMultiByte(CP, WC_COMPOSITECHECK, unicode_str, -1,
C_str, reqSize, NULL, NULL) - 1;
}
else
{
C_str = (char *) pemalloc(sizeof(char), persistent);
*C_str = 0;
php_error(E_WARNING,"Error in php_OLECHAR_to_char()");
}
if(out_length)
*out_length = length;
return C_str;
}