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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php