GNOME Bugzilla – Bug 723106
search-provider: Reimplement normalize_casefold_and_unaccent in terms of g_str_to_ascii
Last modified: 2014-04-03 09:43:34 UTC
This removes our copy-pasted unaccenting logic. It would be even better if GLib had an API that just did the unaccenting because we are not interested in the tokenizing.
Created attachment 267316 [details] [review] search-provider: Reimplement normalize_casefold_and_unaccent
Hmm. It's not apparent to me that the before and the after code are equivalent...
Maybe the incoming g_str_to_ascii could come in handy ?
Sorry for letting this slip through the cracks. As Matthias says, I think the new g_str_to_ascii is what we want to use here. It did not exist when I wrote this patch, so I abused g_str_tokenize_and_fold instead. Now that g_str_to_ascii exists and g_str_tokenize_and_fold is implemented in terms of it, we can just use the new API. Christian, what did you find suspicious? Are you curious about why I did not use g_str_match_string? I explained that bit in https://bugzilla.gnome.org/show_bug.cgi?id=711075#c22 Or is it something else?
Created attachment 273465 [details] [review] search-provider: Reimplement normalize_casefold_and_unaccent Redone in terms of g_str_to_ascii.
Comment on attachment 273465 [details] [review] search-provider: Reimplement normalize_casefold_and_unaccent >+GLIB_REQUIRED=2.39.91 Use 2.40.0. With that fixed, ok to commit. Thanks!
Created attachment 273506 [details] [review] search-provider: Reimplement normalize_casefold_and_unaccent Fixed as suggested and committed.