From d5907b653b7fe8c1830563b56c44bc1016c94ba1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 11 May 2003 19:08:24 +0000 Subject: Fix google smart bookmarks to use utf8 2003-05-11 Marco Pesenti Gritti * data/starthere/smartbookmarks.xml.in: Fix google smart bookmarks to use utf8 * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_solve_smart_url): Fix google smart bookmarks to use utf8. Escape the search string before merging it in the url. --- ChangeLog | 11 +++++++++++ data/starthere/smartbookmarks.xml.in | 4 ++-- src/bookmarks/ephy-bookmarks.c | 8 ++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a52077f5..47135ea2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-05-11 Marco Pesenti Gritti + + * data/starthere/smartbookmarks.xml.in: + + Fix google smart bookmarks to use utf8 + + * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_solve_smart_url): + + Fix google smart bookmarks to use utf8. + Escape the search string before merging it in the url. + 2003-05-11 Christian Persch * src/statusbar.c: (statusbar_init), (statusbar_finalize): diff --git a/data/starthere/smartbookmarks.xml.in b/data/starthere/smartbookmarks.xml.in index 946b57a22..265bd084d 100644 --- a/data/starthere/smartbookmarks.xml.in +++ b/data/starthere/smartbookmarks.xml.in @@ -18,10 +18,10 @@ bookmarks will be displayed. Just choose one of them to perform the search. The next time you type a word, just pressing the Enter key will be enough to perform the same action. - + Search the web - Google - + Search images - Google diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index b67e5cd11..529ad0d5d 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -28,6 +28,7 @@ #include #include +#include #define EPHY_BOOKMARKS_XML_VERSION "0.1" @@ -58,7 +59,7 @@ static const EphyBookmarksBookmarkInfo default_bookmarks [] = * "http://www.google.nl" and "http://www.google.nl/search?q=%s" */ - { N_("Search the web"), N_("http://www.google.com"), N_("http://www.google.com/search?q=%s") } + { N_("Search the web"), N_("http://www.google.com"), N_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8") } }; static int n_default_bookmarks = G_N_ELEMENTS (default_bookmarks); @@ -907,6 +908,7 @@ ephy_bookmarks_solve_smart_url (EphyBookmarks *eb, gchar *encoding; gchar *smarturl_only; gchar *arg; + gchar *escaped_arg; g_return_val_if_fail (content != NULL, NULL); @@ -922,17 +924,19 @@ ephy_bookmarks_solve_smart_url (EphyBookmarks *eb, arg = g_convert (content, strlen (content), encoding, "UTF-8", NULL, NULL, NULL); + escaped_arg = gnome_vfs_escape_string (arg); t1 = smarturl_only; t2 = strstr (t1, "%s"); g_return_val_if_fail (t2 != NULL, NULL); g_string_append_len (s, t1, t2 - t1); - g_string_append (s, arg); + g_string_append (s, escaped_arg); t1 = t2 + 2; g_string_append (s, t1); ret = g_string_free (s, FALSE); g_free (arg); + g_free (escaped_arg); g_free (encoding); g_free (smarturl_only); -- cgit v1.2.3