GNOME Bugzilla – Bug 702977
Problem with gtk_text_iter_forward_search(), multi-byte characters, case sensitive
Last modified: 2013-08-03 15:04:36 UTC
Probably with gtk_text_iter_backward_search() too. If the buffer contains "éb" (é is a two-bytes character), and we search "éb", only "é" will be returned. The bug doesn't occur with the GTK_TEXT_SEARCH_CASE_INSENSITIVE flag enabled. I plan to write more unit tests and fix the bug in the near future.
Created attachment 247659 [details] [review] textiter: bug fix in forward_search() and backward_search() When the search is case sensitive, g_utf8_normalize() is not called, so the skip_decomp argument of the function forward_chars_with_skipping() must be FALSE. To verify that, when searching "éb", the count parameter of forward_chars_with_skipping() have a different value: - case sensitive: count = 2 - case insensitive: count = 3 (g_utf8_normalize() has been called) The commit adds unit tests that didn't pass before, and that now pass (without known regression, obviously).
Review of attachment 247659 [details] [review]: Looks good to me.
Pushed, thank you for the review.
*** Bug 705407 has been marked as a duplicate of this bug. ***