GNOME Bugzilla – Bug 423272
find/search doesn't normalize
Last modified: 2007-03-27 19:04:33 UTC
When searching for a file, comment, place or category precomposed characters are not found/search as their equivalent characters in Unicode. Example: - a file has a comment with "école" that's with <U+00E9 LATIN SMALL LETTER E WITH ACUTE>. - search for "école" with <U+0065 LATIN SMALL LETTER E + U+0301 COMBINING ACUTE ACCENT> The file is not found as a match when it should be.
blocks meta bug 423036
gThumb uses g_pattern_match_simple for searches. I think the normalization should happen in g_pattern_match_simple (glib) rather than gThumb. Do you agree? - Mike
(In reply to comment #2) > gThumb uses g_pattern_match_simple for searches. I think the normalization > should happen in g_pattern_match_simple (glib) rather than gThumb. Do you > agree? The lower the better. But we have to be careful that it doesn't break other things. For the moment, it would probably be enough to normalize the patterns when building the list of patterns and to normalize strings right before g_pattern_match_simple/g_pattern_match_string.
Created attachment 85386 [details] [review] normalization patch, v1 Denis, Could you examine and test this patch against trunk? It normalizes search strings and patterns, and it also normalizes returned dialog strings (thus handling new library / catalog names, part of bug 423271). It doesn't address all your issues, but it is a start. - Mike
(In reply to comment #4) > Created an attachment (id=85386) [edit] That looks good to me. - Created catalogs and libraries are normalized. - Creating equivalent names gives the same behaviour as creating bitwise identical name: no warning and nothing is created, this could be another bug ;-) - Creating categories gives a warning as it should - Searching works for comment, place and categories with either equivalent sequence However searching filename is broken. In my test I have files "école.png" and "école.png". Searching for either gives no result. But that seem to have been broken before the patch. btw: The file are incorrectly sorted. I have "école.png", "copy.png", "école.png" in that order. The e+combining diacritics is sorted at the very end.
Created attachment 85392 [details] [review] normalization patch, v2 Denis, This revised patch fixes the sorting issue (thanks for catching that!). I'm not sure about the search issue yet. - Mike
OK, I have committed a patch that fixes the search issue to svn rev 1516. Let me know if it doesn't work correctly... - Mike
Mike: Thank you, only the search filename issue remains.
Did you try the latest svn version (not the patches here)? I thought the search function was working correctly now. - Mike
(In reply to comment #9) > Did you try the latest svn version (not the patches here)? I thought the search > function was working correctly now. You're right, everything works for Search with the SVN version. My bad. Thanks.