GNOME Bugzilla – Bug 572952
Add g_utf8_simple_casefold() for simple case folding (instead of full case folding)
Last modified: 2018-05-24 11:46:07 UTC
the bug has been opened on https://bugs.launchpad.net/bugs/332321 "Version of Package: 2.24.2-0ubuntu1 I expect: When I search and replace "ß" (to change to ß for html) I want all "ss" left unchanged. What happens: "ss" is also replace as if it is an "ß""
Still valid in 3.2
Search and replace is done in Gtk itself
*** Bug 703165 has been marked as a duplicate of this bug. ***
Created attachment 248295 [details] Test g_utf8_casefold()
The problem comes from g_utf8_casefold(). It transforms both ß (lowercase eszett) and ẞ (uppercase eszett) as "ss". It should instead leave ß as-is, and transform ẞ (uppercase eszett) as ß (lowercase eszett).
From http://www.unicode.org/Public/5.1.0/ucd/UCD.html and http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt We can see those lines: > 00DF;LATIN SMALL LETTER SHARP S;Ll;0;L;;;;;N;;German;;; > 1E9E;LATIN CAPITAL LETTER SHARP S;Lu;0;L;;;;;N;;;;00DF; I think it means what I said above: ß -> ß and ẞ -> ß. So the root of the problem is that gunichartables.h is not up-to-date, and should be regenerated with the latest Unicode spec.
gen-unicode-tables.pl in glib takes this file instead (for the case folding): http://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt We can see these lines: > 00DF; F; 0073 0073; # LATIN SMALL LETTER SHARP S > 1E9E; F; 0073 0073; # LATIN CAPITAL LETTER SHARP S > 1E9E; S; 00DF; # LATIN CAPITAL LETTER SHARP S It seems that glib takes the full case folding (letter F) instead of the simple case folding (letter S). 0073 is the letter 's'. So the desired behavior for gtk_text_iter_forward_search() (with the case insensitive flag) is the simple case folding, not the full case folding.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/199.