aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--data/starthere/smartbookmarks.xml.in4
-rw-r--r--src/bookmarks/ephy-bookmarks.c8
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 <marco@it.gnome.org>
+
+ * 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 <chpe+gnomebugz@stud.uni-saarland.de>
* 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.
</_paragraph>
-<smartbookmark normal="http://www.google.com/" smart="http://www.google.com/search?q=%s" title="Search the web - Google">
+<smartbookmark normal="http://www.google.com/" smart="http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8" title="Search the web - Google">
Search the web - Google
</smartbookmark>
-<smartbookmark normal="http://images.google.com/" smart="http://images.google.com/images?q=%s" title="Search images - Google">
+<smartbookmark normal="http://images.google.com/" smart="http://images.google.com/images?q=%s&ie=UTF-8&oe=UTF-8" title="Search images - Google">
Search images - Google
</smartbookmark>
</content>
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 <string.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
#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);