diff options
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++; |
