Field end cut when they contain non-ascii utf-8 letters

Bug #1817885 reported by Daniel Agocs on 2019-02-27
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MenuLibre
Undecided
Unassigned

Bug Description

When editing an item like Browser in hungarian OS, where the name is Webböngésző, every save cuts the end of text, to like Webböngés. The solution is to remove length parameter from GLib.markup_escape_text in escapeText function. Please patch it.

Daniel Agocs (agocsdaniel) wrote :
Serdar Sağlam (serdarsaglam) wrote :

Hi
Fedora 30 does not work on

[serdar@fedora Masaüstü]$ menulibre

(menulibre:8936): Gtk-WARNING **: 02:47:49.044: gtk_menu_attach_to_widget(): menu already attached to GtkMenuButton

(menulibre:8936): Gtk-WARNING **: 02:47:49.131: gtk_menu_attach_to_widget(): menu already attached to GtkMenuButton
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/menulibre/MenulibreApplication.py", line 2216, in do_activate
    self.win = MenulibreWindow(self, headerbar)
  File "/usr/lib/python3.7/site-packages/menulibre/MenulibreApplication.py", line 249, in __init__
    self.configure_application_treeview(builder)
  File "/usr/lib/python3.7/site-packages/menulibre/MenulibreApplication.py", line 588, in configure_application_treeview
    self.treeview = MenulibreTreeview.Treeview(self, builder)
  File "/usr/lib/python3.7/site-packages/menulibre/MenulibreTreeview.py", line 47, in __init__
    self._configure_treeview(builder)
  File "/usr/lib/python3.7/site-packages/menulibre/MenulibreTreeview.py", line 58, in _configure_treeview
    treestore = MenuEditor.get_treestore()
  File "/usr/lib/python3.7/site-packages/menulibre/MenuEditor.py", line 122, in get_treestore
    return menu_to_treestore(treestore, None, menu)
  File "/usr/lib/python3.7/site-packages/menulibre/MenuEditor.py", line 110, in menu_to_treestore
    treestore = menu_to_treestore(treestore, treeiter, item[3])
  File "/usr/lib/python3.7/site-packages/menulibre/MenuEditor.py", line 99, in menu_to_treestore
    tooltip = escapeText(item[2]['comment'])
  File "/usr/lib/python3.7/site-packages/menulibre/util.py", line 98, in escapeText
    return GLib.markup_escape_text(text, len(text))
  File "/usr/lib64/python3.7/site-packages/gi/overrides/GLib.py", line 415, in markup_escape_text
    return GLib.markup_escape_text(text, length)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 28: unexpected end of data

Serdar Sağlam (serdarsaglam) wrote :

cut.patch working
Daniel Agocs thank you :)

Manuel: sudo gedit /usr/lib/python3.7/site-packages/menulibre/util.py

Python version may differ from you.

Search: return GLib.markup_escape_text(text, len(text))
Replace and save: return GLib.markup_escape_text(text)

Juan Simón (simonbcn) wrote :

Same problem on Arch Linux with Python 3.7.3.
The previous fix solves the problem.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers