1
0
mirror of https://github.com/php/php-src.git synced 2026-04-30 03:33:17 +02:00

this should finally fix bug #14353

This commit is contained in:
Harald Radi
2002-05-15 17:59:48 +00:00
parent bef1729fc6
commit 37b9089bfa
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -770,7 +770,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
if (strlen == -1) {
/* request needed buffersize */
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, -1, NULL, 0);
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, -1, NULL, 0);
} else {
/* \0 terminator */
strlen++;
@@ -780,7 +780,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen);
/* convert string */
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, strlen, unicode_str, strlen);
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, strlen, unicode_str, strlen);
} else {
/* return a zero-length string */
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR));
+2 -2
View File
@@ -770,7 +770,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
if (strlen == -1) {
/* request needed buffersize */
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, -1, NULL, 0);
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, -1, NULL, 0);
} else {
/* \0 terminator */
strlen++;
@@ -780,7 +780,7 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRML
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen);
/* convert string */
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED) | MB_ERR_INVALID_CHARS, C_str, strlen, unicode_str, strlen);
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, strlen, unicode_str, strlen);
} else {
/* return a zero-length string */
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR));