[textblock & encoding] 56806 & 56808 are updated
authorWooHyun Jung <wh0705.jung@samsung.com>
Wed, 9 Feb 2011 07:56:12 +0000 (16:56 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Wed, 9 Feb 2011 07:56:12 +0000 (16:56 +0900)
src/lib/canvas/evas_object_textblock.c
src/lib/engines/common/evas_encoding.c

index d964073..ee3f748 100644 (file)
@@ -2356,12 +2356,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
         else
           {
              str = eina_ustrbuf_string_get(n->unicode);
-             alloc_str = eina_unicode_strdup(str + start);
-
-             if (off > 0)
-               {
-                  alloc_str[off] = 0;
-               }
+             alloc_str = eina_unicode_strndup(str + start, off);
              str = alloc_str;
           }
      }
index 2d2a842..96a2690 100644 (file)
@@ -236,14 +236,11 @@ EAPI int
 evas_common_encoding_utf8_get_len(const char *buf)
 {
    /* returns the number of utf8 characters (not bytes) in the string */
-   int index = 0, len = 0;
+   int i = 0, len = 0;
+
+   while (evas_common_encoding_utf8_get_next(buf, &i))
+        len++;
 
-   while (buf[index])
-     {
-       if ((buf[index] & 0xc0) != 0x80)
-         len++;
-       index++;
-     }
    return len;
 }