non-unicode with ucwords. There is also an implementation for unicode ucwords
but that returns different results then strtotitle as it uppercases the
first character of every word, and doesn't *titlecase* a word. The test case
shows that.
write the uppercased character to the buffer, but only returns the length of
the uppercased letter as per
http://icu.sourceforge.net/apiref/icu4c/ustring_8h.html#a50.
- Updated is_string():
If Unicode semantics is turned on, return "true" for Unicode strings only.
If Unicode semantics is turned off, return "true" for native strings only.
- Added is_binary() function that returns "true" for native strings only.
- Added first implementation of upgraded strtr function. It works except if
combining sequences or surrogates are used in the non-array method of calling
this function.
- In the first one we were calculating the tmp_len wrong which made the
u_strFromUTF32() function try to convert too many code points.
- The second issue was a bit more subtle as the "what" string wasn't
duplicated but still modified. This string is passed as data to the
function and this kind of data the engine tries to free when the function
ends. Because we were re-allocating the data the original memory location
was already freed resulting in a double free error when the engine tries to
free the argument as it was passed to the function.
# Note that this is different from i18n_strtotitle() which uses
# locale-aware word break iterator. The difference is seen here:
#
# $a = "pouvez-vous";
# var_dump(ucwords($a));
# var_dump(i18n_strtotitle($a));
#
# Outputs:
#
# unicode(11) "Pouvez-vous"
# unicode(11) "Pouvez-Vous"
#
- use the same type (int) for zval.value.usr.len and zval.value.str.len
- use union "zstr" as char*/UChar* mixture instead of void*
- Z_UNISTR() and Z_UNILEN() no longer check for Z_TYPE()
- nuke int32_t from ZE (not finisned)
Now IS_BINRAY data type is removed and IS_STRING starts behave as IS_BINARY in unicode mode. IS_STRING is incompatible with IS_UNICODE, so ALL functions should be improved to support unicode mode.