Re: [PHP-I18N] is_string()
[email protected] (Andrei Zmievski)
| Newsgroups | php.i18n |
|---|---|
| Message-ID | <[email protected]> |
I guess I can live with this. It's just a little strange that we have only 2 string types, but 3 casts.. I would also say we need to allow automatic upconversion on binary/unicode concatenation and comparison using runtime encoding. We should also restrict binary string literals to contain ASCII chars only, to avoid encoding problems. If non-ASCII chars are required they can use \u, \U, or \C escape sequences. -Andrei On Mar 15, 2006, at 2:48 AM, Marcus Boerger wrote: > I would prefer a slightly different approach and make is_string() > return > true for both native and unicode strings. This would lead to the > following > layout: > > is_string(): Z_TYPE_P() == IS_STRING || Z_TYPE_P() == IS_UNICODE > (string): bypass native + unicode, convert according to unicode mode; > make_printable_zval > > is_binary(): Z_TYPE_P() == IS_STRING > (binary): bypass native; make_string_zval > > is_unicode(): Z_TYPE_P() == IS_UNICODE > (unicode): bypass unicode: make_unicode_string > > which to me makes pretty much sense. The point is that we still have > automatic conversion mostly everywhere or will get it nearly everywhere > sooner or later. So when dealing with a string variable it doesn't > really > matter what kind it is and if so one has the ability to check for the > exact type. > > Best regards, > marcus > > -- > PHP Unicode & I18N Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php