diff options
author | Jürg Billeter <j@bitron.ch> | 2011-02-02 16:58:03 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2011-02-02 18:22:23 +0100 |
commit | 6a3ac91254e7c7f057a9f6bf8efb6312c0175eb7 (patch) | |
tree | 333b96100355489ff448bd569fc1bbddb388f1ef | |
parent | bf112046e6e5218334df299f01d79437f1fd7024 (diff) | |
download | tracker-6a3ac91254e7c7f057a9f6bf8efb6312c0175eb7.tar.gz |
libtracker-data: Fix fn:starts-with for libunistring and glib collators
Fixes GB#636074.
-rw-r--r-- | src/libtracker-data/libtracker-data.vapi | 3 | ||||
-rw-r--r-- | src/libtracker-data/tracker-collation.h | 7 | ||||
-rw-r--r-- | src/libtracker-data/tracker-sparql-expression.vala | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi index 0caf4b6d5..cc213ea0c 100644 --- a/src/libtracker-data/libtracker-data.vapi +++ b/src/libtracker-data/libtracker-data.vapi @@ -200,4 +200,7 @@ namespace Tracker { [CCode (cheader_filename = "libtracker-data/tracker-db-interface-sqlite.h")] public const string COLLATION_NAME; + + [CCode (cheader_filename = "libtracker-data/tracker-collation.h")] + public const unichar COLLATION_LAST_CHAR; } diff --git a/src/libtracker-data/tracker-collation.h b/src/libtracker-data/tracker-collation.h index 469349a30..93afae2ec 100644 --- a/src/libtracker-data/tracker-collation.h +++ b/src/libtracker-data/tracker-collation.h @@ -34,6 +34,13 @@ gint tracker_collation_utf8 (gpointer collator, gint len2, gconstpointer str2); +#ifdef HAVE_LIBICU +#define TRACKER_COLLATION_LAST_CHAR ((gunichar) 0x10fffd) +#else +/* glibc-based collators do not properly sort private use characters */ +#define TRACKER_COLLATION_LAST_CHAR ((gunichar) 0x9fa5) +#endif + G_END_DECLS #endif /* __LIBTRACKER_COMMON_COLLATION_H__ */ diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala index 760cc9056..299bfe8e8 100644 --- a/src/libtracker-data/tracker-sparql-expression.vala +++ b/src/libtracker-data/tracker-sparql-expression.vala @@ -450,7 +450,7 @@ class Tracker.Sparql.Expression : Object { sql.append ("?"); binding = new LiteralBinding (); - binding.literal = prefix + ((unichar) 0x10fffd).to_string (); + binding.literal = prefix + COLLATION_LAST_CHAR.to_string (); query.bindings.append (binding); return PropertyType.BOOLEAN; |