Blob Blame History Raw
From 314f17ee0cb4c0b5d616b6efa08bd4fb5929deef Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@igalia.com>
Date: Wed, 10 Dec 2014 20:38:49 +0100
Subject: [PATCH 03/15] Properly display UTF-8 URLs in the location entry

https://bugzilla.gnome.org/show_bug.cgi?id=710004
---
 lib/widgets/ephy-location-entry.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 4d3ad89..82c04f1 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -1328,7 +1328,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
 	GtkWidget *widget = GTK_WIDGET (entry);
 	EphyLocationEntryPrivate *priv = entry->priv;
 	GtkClipboard *clipboard;
-	const char *text;
+	char *text;
 	char *effective_text = NULL, *selection = NULL;
 	int start, end;
 
@@ -1357,7 +1357,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
 		if (g_str_has_prefix (address, EPHY_ABOUT_SCHEME))
 			effective_text = g_strdup_printf ("about:%s",
 							  address + strlen (EPHY_ABOUT_SCHEME) + 1);
-		text = address;
+		text = g_uri_unescape_string (address, NULL);
 		gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
 						GTK_ENTRY_ICON_PRIMARY,
 						priv->drag_targets,
@@ -1365,7 +1365,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
 	}
 	else
 	{
-		text = "";
+		text = g_strdup ("");
 		gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
 						GTK_ENTRY_ICON_PRIMARY,
 						NULL,
@@ -1378,6 +1378,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
 	priv->block_update = TRUE;
 	gtk_entry_set_text (GTK_ENTRY (widget), effective_text ? effective_text : text);
 	priv->block_update = FALSE;
+	g_free (text);
 	g_free (effective_text);
 
 	/* We need to call update_address_state() here, as the 'changed' signal
-- 
2.1.0