That assumes there are a hundred places where you want to receive an ASCII string. Are they really that prevalent?

-Andrei

On May 15, 2006, at 12:42 PM, Nuno Lopes wrote:

Sorry for the delay.
But I think that a new type specifier could be introduced. If not you are saying to extensions writers to duplicate the code below a hundred times:

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "t", &name, &name_len, &name_type) == FAILURE) {
   return;
}

if (name_type == IS_UNICODE) {
   buf = zend_unicode_to_ascii(name, name_len TSRMLS_CC);
   if (buf == NULL) {
php_error(E_WARNING, "my_var has to consist only of ASCII characters");
       RETURN_FALSE;
   }
} else {
   buf = (char *) name;
}


With a new specifier you would be sure that the string you received was ASCII-only and wouldn't have to care with conversions and such.


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to