On Sep 5, 2005, at 3:55 AM, Rolland Santimano wrote:

+        while (i < input_len) {
+            U16_FWD_1((UChar *)input, i, input_len);
+            input_codepts++;


There's u_countChar32() function that counts the number of codepoints.

+    if (input_type == IS_UNICODE) {
+        result = emalloc(UBYTES(input_len + num_pad_chars*2 + 1));
+    } else {
+        result = emalloc(input_len + num_pad_chars + 1);
+    }

It's probably better to use eumalloc() for allocating Unicode strings, since it takes care of counting the bytes..

+        result = erealloc(result, UBYTES(result_len+1));

Same here, eurealloc()..

-Andrei

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to