Re: Unicode progress [Was: unicode.semantics ad infinitum]

From: Date: Sat, 24 May 2008 12:55:03 +0000
Subject: Re: Unicode progress [Was: unicode.semantics ad infinitum]
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-37850@lists.php.net to get a copy of this message
Hi Andrei, I see where you're coming from over the (binary)|(string) issue, just trying to find some way that would preserve a little more back compatibility.
UG(ascii_conv) is for the format string, not the arguments. The warning is thrown by this code:
      convert_to_string_ex(argv[currentarg]);
It should check the arg type and return with a warning if it's Unicode.
OK, so there are some things that should maybe 'just happen' here, and also when 'S' is used: PHP_NAMED_FUNCTION(php_if_crc32) { char *p; int len, nr; php_uint32 crcinit = 0; register php_uint32 crc; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &p, &nr) == FAILURE) { return; } ... Warning: crc32() expects parameter 1 to be strictly a binary string, Unicode string given in ... Surely if a function's *expecting* a binary string it should do a silent conversion, and only throw a warning if the conversion fails? I don't see why the onus should always be on the user to adapt to this. - Steph

« previous php.internals (#37850) next »