gtk_text_iter_get_char() and g_unichar_isspace()



If I have a while loop and I am iterating through a GtkTextBuffer with
gtk_text_iter_forward_char(&iter).  Can I expect
g_unichar_isspace(gtk_text_iter_get_char(&iter)) to work if there is a space
in the text?

Ideally I would use gtk_text_iter_forward_word_ends() and
gtk_text_iter_backward_word_starts() but my delimiters are a form-feed (\f),
newline (\n), carriage return (\r), horizontal tab (\t), and vertical tab
(\v). I found these functions to stop on puncutation marks (such as full
stops etc) which is to be expected. Is there a better way?

I have noticed gtk_text_buffer_get_char_count(mybuffer) returns a number
less than the number of character I have typed (probably because of the text
encoding). As a result I don't see how checking for a g_unichar_isspace() on
that particular GtkTextIter can work in my situation.  Can anyone enlighten
me?

Regards,
Martyn  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]