[rhythmbox] rhythmdb: fix sort order for composed characters (bug #542055)



commit fecd44feb8b228509f1ece1e442eb42e47817d22
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Jan 24 22:15:37 2010 +1000

    rhythmdb: fix sort order for composed characters (bug #542055)
    
    Previously, we created the sort key based on the folded version of the
    string.   Our custom folding function removes all combining characters,
    which in some locales are important for sorting, so the resulting
    strings didn't sort correctly.  Now we create the sort key using
    g_utf8_casefold rather than the custom folding function.

 rhythmdb/rb-refstring.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/rhythmdb/rb-refstring.c b/rhythmdb/rb-refstring.c
index c45f7c2..a2a42a6 100644
--- a/rhythmdb/rb-refstring.c
+++ b/rhythmdb/rb-refstring.c
@@ -195,10 +195,11 @@ rb_refstring_get_sort_key (RBRefString *val)
 	string = (const char *)g_atomic_pointer_get (ptr);
 	if (string == NULL) {
 		char *newstring;
-		const char *s;
+		char *s;
 
-		s = rb_refstring_get_folded (val);
+		s = g_utf8_casefold (val->value, -1);
 		newstring = g_utf8_collate_key_for_filename (s, -1);
+		g_free (s);
 
 		if (g_atomic_pointer_compare_and_exchange (ptr, NULL, newstring)) {
 			string = newstring;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]