[Sugar-devel] [PATCH Browse] Use UNICODE string to search into places SL #2830
Manuel Quiñones
manuq at laptop.org
Wed May 2 12:24:37 EDT 2012
Hi humitos,
2012/5/2 Manuel Kaufmann <humitos at gmail.com>:
> Decode (using 'utf-8') the string inserted by the user in the URL address bar
> to search with SQLite into places' database.
>
> Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
> ---
> webtoolbar.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/webtoolbar.py b/webtoolbar.py
> index d0f2dc9..c595206 100644
> --- a/webtoolbar.py
> +++ b/webtoolbar.py
> @@ -120,7 +120,8 @@ class WebEntry(iconentry.IconEntry):
> def _search_update(self):
> list_store = Gtk.ListStore(str, str)
>
> - for place in places.get_store().search(self.props.text):
> + search_text = self.props.text.decode('utf-8')
> + for place in places.get_store().search(search_text):
> list_store.append([place.uri, place.title])
>
> self._search_view.set_model(list_store)
> --
> 1.7.10
>
Works for me in my dev machine and in the XO. Are we safe to assume
that the text in GtkEntry is utf-8 ?
--
.. manuq ..
More information about the Sugar-devel
mailing list