diff options
| author | Trever Fischer <tdfischer@fedoraproject.org> | 2012-04-18 14:45:06 -0400 |
|---|---|---|
| committer | Trever Fischer <tdfischer@fedoraproject.org> | 2012-04-18 14:45:06 -0400 |
| commit | 27eec13bd689260b7e06570601ebb6a08ec0aede (patch) | |
| tree | 278aa035fe0a494db586f146c45da2f1fcb4c9b6 /extensions/fts++/stringutils.cpp | |
| parent | f0adfc5db0b17cb7d21c38df125a7a4673d0dd8a (diff) | |
| parent | 75ca272b8dc4ee42bcf9ea12b17c9325612bdbd5 (diff) | |
| download | zeitgeist-27eec13bd689260b7e06570601ebb6a08ec0aede.tar.gz | |
Merge branch 'master' into tdfischer/event-cachingtdfischer/event-caching
Conflicts:
.gitignore
src/db-reader.vala
Diffstat (limited to 'extensions/fts++/stringutils.cpp')
| -rw-r--r-- | extensions/fts++/stringutils.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/extensions/fts++/stringutils.cpp b/extensions/fts++/stringutils.cpp index 6cc5cba8..9c9d2d7d 100644 --- a/extensions/fts++/stringutils.cpp +++ b/extensions/fts++/stringutils.cpp @@ -69,9 +69,13 @@ string Truncate (string const& s, unsigned int nbytes) */ string MangleUri (string const& orig) { - string s(orig); + // the input is supposed to be a uri, so no utf8 characters + gchar *casefolded = g_ascii_strdown (orig.c_str (), orig.size ()); + + string s(casefolded); + g_free (casefolded); size_t pos = 0; - while ((pos = s.find_first_of (": /", pos)) != string::npos) + while ((pos = s.find_first_of (": /-.%", pos)) != string::npos) { s.replace (pos, 1, 1, '_'); pos++; |
