Fix quickfill for unicode strings with accents

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fix quickfill for unicode strings with accents

Didier Vidal
Current behaviour of quickfill is not appropriate for UTF-8 string that
contain accents.
The reference strings are stored in a 'normalized form' that transforms
a single letter (letter + accent) in two letters (the letter, then the
accent). This has side effects, in the quick fill that is returned and
displayed (é is displayed e'), accounts that are not recognized etc...

NORMALIZE_NFC provides a much more usable behaviour.

More info about utf-8 normalization modes can be found at
http://developer.gnome.org/doc/API/2.0/glib/glib-Unicode-Manipulation.html#GNormalizeMode

Didier.

------------------------------------
prompt> cvs -q diff -u
Index: QuickFill.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/QuickFill.c,v
retrieving revision 1.1.4.3
diff -u -r1.1.4.3 QuickFill.c
--- QuickFill.c 22 Jul 2005 18:53:01 -0000      1.1.4.3
+++ QuickFill.c 1 Oct 2005 11:51:31 -0000
@@ -266,7 +266,7 @@
   if (NULL == text) return;
 
 
-  normalized_str = g_utf8_normalize (text, -1, G_NORMALIZE_DEFAULT);
+  normalized_str = g_utf8_normalize (text, -1, G_NORMALIZE_NFC);
   quickfill_insert_recursive (qf, normalized_str, 0, sort);
   g_free (normalized_str);
 }


_______________________________________________
gnucash-patches mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-patches