RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt
On Wed, 17 Aug 2005, Dmitry Stogov wrote: May be nice to have, however ASCII to unicode conversion is not usual case. Usualy we have non ASCII but some encoding (UG(runrime_encoding)). But we can have a macro for that too, isn't it? :) Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt
Agree. Dmitry. -Original Message- From: Derick Rethans [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 17, 2005 10:51 AM To: Dmitry Stogov Cc: 'Andi Gutmans'; php-cvs@lists.php.net Subject: RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt On Wed, 17 Aug 2005, Dmitry Stogov wrote: May be nice to have, however ASCII to unicode conversion is not usual case. Usualy we have non ASCII but some encoding (UG(runrime_encoding)). But we can have a macro for that too, isn't it? :) Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt
May be nice to have, however ASCII to unicode conversion is not usual case. Usualy we have non ASCII but some encoding (UG(runrime_encoding)). Dmitry. -Original Message- From: Andi Gutmans [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 17, 2005 4:54 AM To: Dmitry Stogov; php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt Shouldn't we have a macro that does this? I see lots of places that require the same code. - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } Andi At 10:18 AM 8/16/2005 +, Dmitry Stogov wrote: dmitry Tue Aug 16 06:18:43 2005 EDT Modified files: /php-src/ext/standard md5.c /php-src/ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phpt strstr.phpt Log: Unicode support http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.3 9r2=1.40 ty=u Index: php-src/ext/standard/md5.c diff -u php-src/ext/standard/md5.c:1.39 php-src/ext/standard/md5.c:1.40 --- php-src/ext/standard/md5.c:1.39 Wed Aug 3 10:08:09 2005 +++ php-src/ext/standard/md5.c Tue Aug 16 06:18:41 2005 @@ -16,7 +16,7 @@ + --+ */ -/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */ +/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */ /* * md5.c - Copyright 1997 Lachlan Roche @@ -61,7 +61,12 @@ RETURN_STRINGL(digest, 16, 1); } else { make_digest(md5str, digest); - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, + 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } } @@ -108,7 +113,12 @@ RETURN_STRINGL(digest, 16, 1); } else { make_digest(md5str, digest); - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, + 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } } /* }}} */ http://cvs.php.net/diff.php/php-src/ext/standard/tests/string s/explode. phpt?r1=1.4r2=1.5ty=u Index: php-src/ext/standard/tests/strings/explode.phpt diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4 php-src/ext/standard/tests/strings/explode.phpt:1.5 --- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18 07:34:28 2004 +++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16 06:18:43 2005 @@ -152,3 +152,127 @@ [0]= string(10) a lazy dog } +--UEXPECTF-- +26d4e18734cb2582df5055e2175223df +bool(false) +bool(false) +bool(false) +array(1) { + [0]= + unicode(0) +} +array(2) { + [0]= + unicode(0) + [1]= + unicode(0) +} +array(1) { + [0]= + unicode(0) +} +bool(false) +array(1) { + [0]= + unicode(3) acb +} +array(1) { + [0]= + unicode(11) otherstring +} +array(7) { + [0]= + unicode(0) + [1]= + unicode(0) + [2]= + unicode(0) + [3]= + unicode(0) + [4]= + unicode(0) + [5]= + unicode(0) + [6]= + unicode(0) +} +array(1) { + [0]= + unicode(60) +-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=- +} +array(21) { + [0]= + unicode(1) - + [1]= + unicode(2) 48 + [2]= + unicode(2) -- + [3]= + unicode(2) 48 + [4]= + unicode(2) -- + [5]= + unicode(2) 48 + [6]= + unicode(2) -- + [7]= + unicode(2) 48 + [8]= + unicode(2) -- + [9]= + unicode(2) 48 + [10]= + unicode(2) -- + [11]= + unicode(2) 48 + [12]= + unicode(2) -- + [13]= + unicode(2) 48 + [14]= + unicode(2) -- + [15]= + unicode(2) 48 + [16]= + unicode(2) -- + [17]= + unicode(2) 48 + [18]= + unicode(2) -- + [19]= + unicode(2) 48 + [20]= + unicode(1) - +} +array(3) { + [0]= + unicode(10) a lazy dog + [1]= + unicode(5) jumps + [2]= + unicode(4) over +} +array(2) { + [0]= + unicode(10) a lazy dog + [1]= + unicode(5) jumps +} +array(1) { + [0]= + unicode(10) a lazy dog +} +array(0) { +} +array(0) { +} +array(2) { + [0]= + unicode(10) a lazy dog + [1]= + unicode(11) jumps::over +} +array(1) { + [0]= + unicode(10) a lazy dog +} http://cvs.php.net/diff.php/php
RE: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt
Oh, I didn't realize this was literally meant to be ASCII. In such case, there probably aren't going to be many places At 09:36 AM 8/17/2005 +0400, Dmitry Stogov wrote: May be nice to have, however ASCII to unicode conversion is not usual case. Usualy we have non ASCII but some encoding (UG(runrime_encoding)). Dmitry. -Original Message- From: Andi Gutmans [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 17, 2005 4:54 AM To: Dmitry Stogov; php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src /ext/standard md5.c /ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phptstrstr.phpt Shouldn't we have a macro that does this? I see lots of places that require the same code. - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } Andi At 10:18 AM 8/16/2005 +, Dmitry Stogov wrote: dmitry Tue Aug 16 06:18:43 2005 EDT Modified files: /php-src/ext/standard md5.c /php-src/ext/standard/tests/strings explode.phpt strcspn.phpt strspn.phpt strstr.phpt Log: Unicode support http://cvs.php.net/diff.php/php-src/ext/standard/md5.c?r1=1.3 9r2=1.40 ty=u Index: php-src/ext/standard/md5.c diff -u php-src/ext/standard/md5.c:1.39 php-src/ext/standard/md5.c:1.40 --- php-src/ext/standard/md5.c:1.39 Wed Aug 3 10:08:09 2005 +++ php-src/ext/standard/md5.c Tue Aug 16 06:18:41 2005 @@ -16,7 +16,7 @@ + --+ */ -/* $Id: md5.c,v 1.39 2005/08/03 14:08:09 sniper Exp $ */ +/* $Id: md5.c,v 1.40 2005/08/16 10:18:41 dmitry Exp $ */ /* * md5.c - Copyright 1997 Lachlan Roche @@ -61,7 +61,12 @@ RETURN_STRINGL(digest, 16, 1); } else { make_digest(md5str, digest); - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, + 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } } @@ -108,7 +113,12 @@ RETURN_STRINGL(digest, 16, 1); } else { make_digest(md5str, digest); - RETVAL_STRING(md5str, 1); + if (UG(unicode)) { + UChar *u_temp = zend_ascii_to_unicode(md5str, + 33 ZEND_FILE_LINE_CC); + RETVAL_UNICODE(u_temp, 0); + } else { + RETVAL_STRING(md5str, 1); + } } } /* }}} */ http://cvs.php.net/diff.php/php-src/ext/standard/tests/string s/explode. phpt?r1=1.4r2=1.5ty=u Index: php-src/ext/standard/tests/strings/explode.phpt diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4 php-src/ext/standard/tests/strings/explode.phpt:1.5 --- php-src/ext/standard/tests/strings/explode.phpt:1.4 Sun Jul 18 07:34:28 2004 +++ php-src/ext/standard/tests/strings/explode.phpt Tue Aug 16 06:18:43 2005 @@ -152,3 +152,127 @@ [0]= string(10) a lazy dog } +--UEXPECTF-- +26d4e18734cb2582df5055e2175223df +bool(false) +bool(false) +bool(false) +array(1) { + [0]= + unicode(0) +} +array(2) { + [0]= + unicode(0) + [1]= + unicode(0) +} +array(1) { + [0]= + unicode(0) +} +bool(false) +array(1) { + [0]= + unicode(3) acb +} +array(1) { + [0]= + unicode(11) otherstring +} +array(7) { + [0]= + unicode(0) + [1]= + unicode(0) + [2]= + unicode(0) + [3]= + unicode(0) + [4]= + unicode(0) + [5]= + unicode(0) + [6]= + unicode(0) +} +array(1) { + [0]= + unicode(60) +-=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=--=48=- +} +array(21) { + [0]= + unicode(1) - + [1]= + unicode(2) 48 + [2]= + unicode(2) -- + [3]= + unicode(2) 48 + [4]= + unicode(2) -- + [5]= + unicode(2) 48 + [6]= + unicode(2) -- + [7]= + unicode(2) 48 + [8]= + unicode(2) -- + [9]= + unicode(2) 48 + [10]= + unicode(2) -- + [11]= + unicode(2) 48 + [12]= + unicode(2) -- + [13]= + unicode(2) 48 + [14]= + unicode(2) -- + [15]= + unicode(2) 48 + [16]= + unicode(2) -- + [17]= + unicode(2) 48 + [18]= + unicode(2) -- + [19]= + unicode(2) 48 + [20]= + unicode(1) - +} +array(3) { + [0]= + unicode(10) a lazy dog + [1]= + unicode(5) jumps + [2]= + unicode(4) over +} +array(2) { + [0]= + unicode(10) a lazy dog + [1]= + unicode(5) jumps +} +array(1) { + [0]= + unicode(10) a lazy dog +} +array(0) { +} +array(0) { +} +array(2) { + [0