aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-12 03:08:24 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-12 03:08:24 +0800
commitd5907b653b7fe8c1830563b56c44bc1016c94ba1 (patch)
treef3068aed960ff808270e37140cf7cbe4ce927b1b
parentcb3c864677acdb69f6c3e71d4c2624482ea7ddc6 (diff)
downloadgsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar.gz
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar.bz2
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar.lz
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar.xz
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.tar.zst
gsoc2013-epiphany-d5907b653b7fe8c1830563b56c44bc1016c94ba1.zip
Fix google smart bookmarks to use utf8
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.
-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);