Gedit join/split lines no(t)w working

Here is a copy and paste of a workaround of a bug signalled for gedit in Ubuntu and Debian I posted there.

Join/split lines doesn’t work in gedit. Why? And: How to solve this annoying bug?

The problem is about the way ord() deals with special characters in the final while of /usr/lib/gedit/plugins/ For example with tonic vocals of the Italian and French languages.

Python and special characters

It seems to be a known issue in python.
You can try it out in python:
>>> char='è'
>>> ord(char)

fails, while
>>> char=u'è'
>>> ord(char)


I did not managed to rewrite a working definition of char in, but I believe that the call ord(char) is only a test for while to check if a character is found. Therefore, if a “string of length” > 1 is given as char, in this case, it does not matter what character is, but only that char contains a character.

The workaround for gedit

As a newby of python, I solved this bug for the split/join-lines plugin replacing the two calls

while ord(char)


while ord(char[:1])

in the final lines of the file /usr/lib/gedit/plugins/

It works!