[PHP-DEV] WG: PHP 4.0 Bug #7155 solved From: Harald Radi (h.radi <email protected>)
Date: 12/28/00

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;
}

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>