GNOME Bugzilla – Bug 335908
Traceback trying to enter U+2022 with Shift+Ctrl in the Invisible Char entry
Last modified: 2006-04-29 18:33:12 UTC
/usr/lib/python2.4/site-packages/gazpacho/debugwindow.py:127: GtkWarning: gtk_te xt_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed self._buffer.insert_with_tags_by_name(end_iter, text, *tags) gazpacho properties/nm-vpnc-dialog.glade 47.85s user 7.28s system 0% cpu 2:04:3 9.50 total File /usr/lib/python2.4/site-packages/gazpacho/editor.py, line 153, in _changed_unichar self.set(text[0]) File /usr/lib/python2.4/site-packages/gazpacho/editor.py, line 91, in set command_manager.set_property(self.property, value) File /usr/lib/python2.4/site-packages/gazpacho/commandmanager.py, line 151, in set_property cmd.execute() File /usr/lib/python2.4/site-packages/gazpacho/command.py, line 385, in execute self._property.set(new_value) File /usr/lib/python2.4/site-packages/gazpacho/properties.py, line 643, in _set raise TypeError("Error while setting %s:%s to %s `%s'" % ( TypeError:
Just a quick note about this bug (I haven't given it much thought so I can be missing something). The problem seems to be the following code: def _changed_unichar(self, entry): if self.property_loading: return text = entry.get_chars(0, -1) if text: self.set(text[0]) Since we are working with normal strings the unicode character will actually be stored as several characters. When doing a text[0] we will not get the unicode character but something else and in this case it seems to be invalid.
Created attachment 61968 [details] [review] Patch (preliminary) I wrote a quick patch that seems to work on my system. Not sure if it assumes too much about the encoding?
Created attachment 62152 [details] [review] Patch This patch should hopefully be correct. Changes: * the encoding of the string will always be utf-8 in gtk (if I'm not mistaken) * no need to encode the unicode string, it will be accepted as it is
Patch committed (slightly modified) Sending ChangeLog Sending gazpacho/editor.py Transmitting file data .. Committed revision 2233.
Setting correct milestone for bugs that have been fixed for the 0.6.6 release.
*** Bug 340131 has been marked as a duplicate of this bug. ***
*** Bug 340130 has been marked as a duplicate of this bug. ***