Re: Re: php-src /ext/com_dotnet com_handlers.c com_variant.c
| From: | Andrey Hristov | Date: | Sat, 13 Aug 2005 21:35:10 +0000 |
| Subject: | Re: Re: php-src /ext/com_dotnet com_handlers.c com_variant.c | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17998@lists.php.net to get a copy of this message | ||
Just my $0.02,
for the MS compilers wchar_t is 2 bytes while for gcc it is 4.
Andrey
Wez Furlong wrote:
"the fundamental representation of text in Windows NT-based operating systems is UTF-16, and the WCHAR data type is a UTF-16 code unit" So, it looks like we don't need to do anything special. --Wez. On 8/13/05, cshmoove@bellsouth.net <cshmoove@bellsouth.net> wrote:Wez, UCS2 is limited to the representing characters within the BMP ( 1 code-unit == 1 code-point) UTF16 uses surrogates to address characters beyond the BMP (so a code-point may be represented by 2 code-units) clayton "Wez Furlong" <kingwez@gmail.com> wrote in message news:4e89b426050813132925837d02@mail.gmail.com... And isn't UTF16 === UCS2 ? --Wez. On 8/13/05, cshmoove@bellsouth.net <cshmoove@bellsouth.net> wrote:"Wez Furlong" <kingwez@gmail.com> wrote in message news:4e89b42605081313165c9414dd@mail.gmail.com... Umm, don't we use UCS2 internally? actually ICU is UTF16... l0t3k --Wez. On 8/13/05, cshmoove@bellsouth.net <cshmoove@bellsouth.net> wrote:-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpWez,-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php+ case IS_UNICODE: + V_VT(v) = VT_BSTR; + V_BSTR(v) = SysAllocString(Z_USTRVAL_P(z)); + break;my understanding is that Win32 uses UCS2, so do we need to account for surrogates ? l0t3k ""Wez Furlong"" <wez@php.net> wrote in message news:cvswez1123959839@cvsserver...wez Sat Aug 13 15:03:59 2005 EDT Modified files: /php-src/ext/com_dotnet com_handlers.c com_variant.c Log: unicode enable COM parameters (but not method/property names yet) http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_handlers.c?r1=1.30&r2=1.31&ty=u Index: php-src/ext/com_dotnet/com_handlers.c diff -u php-src/ext/com_dotnet/com_handlers.c:1.30 php-src/ext/com_dotnet/com_handlers.c:1.31 --- php-src/ext/com_dotnet/com_handlers.c:1.30 Wed Aug 3 10:06:41 2005 +++ php-src/ext/com_dotnet/com_handlers.c Sat Aug 13 15:03:58 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_handlers.c,v 1.30 2005/08/03 14:06:41 sniper Exp $ */ +/* $Id: com_handlers.c,v 1.31 2005/08/13 19:03:58 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -522,6 +522,7 @@ vt = VT_BOOL; break; case IS_STRING: + case IS_UNICODE: vt = VT_BSTR; break; default: http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_variant.c?r1=1.12&r2=1.13&ty=u Index: php-src/ext/com_dotnet/com_variant.c diff -u php-src/ext/com_dotnet/com_variant.c:1.12 php-src/ext/com_dotnet/com_variant.c:1.13 --- php-src/ext/com_dotnet/com_variant.c:1.12 Fri Aug 12 22:23:27 2005 +++ php-src/ext/com_dotnet/com_variant.c Sat Aug 13 15:03:58 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_variant.c,v 1.12 2005/08/13 02:23:27 wez Exp $ */ +/* $Id: com_variant.c,v 1.13 2005/08/13 19:03:58 wez Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -157,6 +157,11 @@ efree(olestring); break; + case IS_UNICODE: + V_VT(v) = VT_BSTR; + V_BSTR(v) = SysAllocString(Z_USTRVAL_P(z)); + break; + case IS_RESOURCE: case IS_CONSTANT: case IS_CONSTANT_ARRAY: @@ -211,12 +216,8 @@ ZVAL_BOOL(z, V_BOOL(v) ? 1 : 0); break; case VT_BSTR: - olestring = V_BSTR(v); - if (olestring) { - Z_TYPE_P(z) = IS_STRING; - Z_STRVAL_P(z) = php_com_olestring_to_string(olestring, - &Z_STRLEN_P(z), codepage TSRMLS_CC); - olestring = NULL; + if (V_BSTR(v)) { + ZVAL_UNICODE(z, V_BSTR(v), 1); } break; case VT_UNKNOWN:-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php