utf8_string = _(hash_label); g_print ("Get Text: %s\n", utf8_string); if (Accessible_isText (object)) { AccessibleText *text = NULL; text = Accessible_getText (object); len = AccessibleText_getCharacterCount (text); Accessible_unref (text); } if ((under_score = g_utf8_strchr (utf8_string, len, '_')) != NULL) { int i = 0; GString *str = NULL; const gchar *p; const gchar *end; str = g_string_sized_new (len + 1); p = utf8_string; end = utf8_string + len; while (p != end) { const gchar *next; g_print ("I: %d - len: %ld\n", i, len); i++; next = g_utf8_next_char (p); if (*p == '_') g_string_append (str, ""); else g_string_append_len (str, p, next - p); p = next; } g_print ("Before: %s - After :%s\n", utf8_string, str->str);