cvs: php4 /ext/mbstring php_unicode.c

From: Date: Wed, 23 Oct 2002 20:32:51 +0000
Subject: cvs: php4 /ext/mbstring php_unicode.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-15223@lists.php.net to get a copy of this message
moriyoshi Wed Oct 23 16:32:51 2002 EDT Modified files: /php4/ext/mbstring php_unicode.c Log: Modified mb_convert_case() to handle cased characters properly when MB_CASE_TITLE is specified. Index: php4/ext/mbstring/php_unicode.c diff -u php4/ext/mbstring/php_unicode.c:1.2 php4/ext/mbstring/php_unicode.c:1.3 --- php4/ext/mbstring/php_unicode.c:1.2 Tue Oct 1 06:16:40 2002 +++ php4/ext/mbstring/php_unicode.c Wed Oct 23 16:32:51 2002 @@ -257,11 +257,26 @@ } break; - case PHP_UNICODE_CASE_TITLE: + case PHP_UNICODE_CASE_TITLE: { + int mode = 0; + for (i = 0; i < unicode_len / sizeof(unsigned long); i++) { - unicode_ptr[i] = php_unicode_totitle(unicode_ptr[i]); + int res = php_unicode_is_prop(unicode_ptr[i], + UC_MN|UC_ME|UC_CF|UC_LM|UC_SK|UC_LU|UC_LL|UC_LT, 0); + if (mode) { + if (res) { + unicode_ptr[i] = php_unicode_tolower(unicode_ptr[i]); + } else { + mode = 0; + } + } else { + if (res) { + mode = 1; + unicode_ptr[i] = php_unicode_totitle(unicode_ptr[i]); + } + } } - break; + } break; }

« previous php.cvs (#15223) next »