After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 344008 - Broken context-sensitive spell check in evolution (Greek, Hebrew, maybe more)
Broken context-sensitive spell check in evolution (Greek, Hebrew, maybe more)
Status: RESOLVED WONTFIX
Product: GtkHtml
Classification: Other
Component: Editing
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtkhtml-maintainers
gtkhtml-maintainers
gnome[unmaintained]
: 556170 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-06-06 13:11 UTC by Simos Xenitellis
Modified: 2017-02-09 13:37 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Reenable spelling suggestions for words containing Non-ASCII Characters (436 bytes, patch)
2009-10-10 21:29 UTC, pminos
committed Details | Review

Description Simos Xenitellis 2006-06-06 13:11:14 UTC
[ moving bug report from 
http://bugzilla.ximian.com/show_bug.cgi?id=70548
(is there a GNOME Bugzilla "gnome-spell" product available? I think gnome-spell bugs from Ximian Bugzilla were left behind). ]

The spell-checker is working, as the words which are mispelled are
underlined with the red jagged line.
However, in the popup menu, there is no menu item that allows you to
make the correction.

I verified that libgtkspell is installed. In the preferences, Greek is
ticked for spelling correction. The same goes with the individual
window setting for spelling correction.

It appears that rectangle in which you can right-click to get the
spelling correction option for Greek, is somehow to small, so one
cannot get it to appear. I tried right-clicking around the mispelled
greek word, but without success. As if the rectangle has zero dimensions.

It appears that other languages would be affected by this. Anyone with
cyrillic, arabic, ???

If someone has garnome or jhbuild with GNOME 2.10, they could test
this issue to see whether it's a configuration issue with Ubuntu or an upstream problem.

I am attaching some screenshots for demonstration purposes.

So far, two users have noticed this issue (for one languag, Greek).

https://bugzilla.ubuntu.com/attachment.cgi?id=1851
Shows Greek text, some words are ok, other are incorrect and marked as
such. So spelling works!

https://bugzilla.ubuntu.com/attachment.cgi?id=1852
On english text (greek dictionary, so any english incorrect), the
pop-up menu comes up with spelling option.

https://bugzilla.ubuntu.com/attachment.cgi?id=1853
For the Greek text, wherever you click does not bring up the spelling
correction menu item."
Comment 1 Simos Xenitellis 2006-06-06 13:13:05 UTC
We are looking for someone to try test with the latest Evolution; perhaps from UBuntu 6.06.
Comment 2 Simos Xenitellis 2006-06-06 17:00:42 UTC
I copy the comment received from the downstream bug,
https://launchpad.net/distros/ubuntu/+source/gnome-spell/+bug/10713


Posted by Konstantinos Togias at 2006-06-06 17:49:15 BST

The bug still persists in Ubuntu 6.06 . I tested on a fresh 6.06 installation (evolution 2.6.1-0ubuntu7) and the behaviour is that described above.
Comment 3 André Klapper 2006-06-08 11:39:54 UTC
not sure if this is a gnome-spell or an evolution issue - anyway: yes, gnome-spell bugs are still handled at bugzilla.ximian.com, but i don't know if anybody is currently maintaining gnome-spell at all :-(
Comment 4 Gregory Nikolaidis 2007-04-18 09:04:22 UTC
In Ubuntu 6.10 the bug is still there.
Upgrading to Ubuntu 7.4 to see if there's any improvement
Comment 5 Stephanos Manos 2007-04-21 13:32:43 UTC
Present in Fedora Core 6 (Evolution 2.8) and in Fedora 7 (Evolution 2.10.1).
Open a new message. Write a miss-spelled Greek word. The word is underlined with the red jagged line. Press F7 (or Edit -> Spell Checking). A pop-up  window appears saying "No misspelled word found". 
Also if you right click on the Greek misspelled word the pop-up menu misses the spell-checker related items compared to an English misspelled word. 
Comment 6 Simos Xenitellis 2007-04-23 09:42:23 UTC
The source code of gnome-spell (most probably affected) is at
http://svn.gnome.org/viewcvs/gnome-spell/trunk/

It would be good to check if other languages are affected. In this way, we can eliminate a problem specific to Greek (or not).
To do so, install the locale of another country (such as Russian) through System/Administration/Language support.
Comment 7 Simos Xenitellis 2007-05-01 15:19:52 UTC
Per https://bugs.launchpad.net/evolution/+bug/10713
the issue appears with the Russian locale as well.

Due to the reorganisation of Ubuntu, the screenshots referenced above at #1 no longer work. Please see
https://bugs.launchpad.net/evolution/+bug/10713 
comments 7 to 9.

According to 
https://bugs.launchpad.net/evolution/+bug/10713/comments/7
the mispelled Greek words are marked correctly (so gnome-spell works), but the context sensitive menu in Evolution does not have any entries to help you pick a correct word.

Therefore, I confirm this bug report, and adjust the title as the issue is not restricted to the Greek language.



Comment 8 Yotam Benshalom 2007-05-14 02:09:11 UTC
This happens with Hebrew spell-checking as well, on Evolution 2.10.1 (Ubuntu Feisty).
Comment 9 Simos Xenitellis 2007-05-18 02:13:03 UTC
Thanks benshalom. Adapting bug title to reflect the new information.
Comment 10 Yotam Benshalom 2007-09-22 00:24:10 UTC
Still not fixed in 2.12.0 on Ubuntu Gutsy.
Comment 11 Simos Xenitellis 2008-04-16 00:04:47 UTC
We had reports in Evolution 2.12.1 (Ubuntu 8.04 Beta aka Hardy) that this bug has been resolved for Green and Russian.

benshalom, could you please check again for Hebrew?
Comment 12 Yotam Benshalom 2008-04-16 03:50:37 UTC
I re-checked after reboot, and unfortunately the problem remains here with Hebrew. I get red underline for errors in English and Hebrew, but only English errors are recognised as such using manual spell check, and only they have getting a list of corrections in right-click menu.
Comment 13 Simos Xenitellis 2008-04-16 08:54:23 UTC
Yotam, in the "downstream" report (at launchpad), there is info that spelling now works for 6-7 languages.

Could you please verify that you are using Evolution 2.12.1 or newer?

Could you please tell me your distribution version? Apparently, Evolution 2.12.1 is available in the beta version of Ubuntu only.
Comment 14 Yotam Benshalom 2008-04-16 11:26:02 UTC
I use ubuntu Hardy, and my Evolution version is 2.22.1.
Comment 15 Simos Xenitellis 2008-04-16 23:25:57 UTC
The downstream report (launchpad.net) has updated information.
It has a success report for Russian and hints that the issue might be related to the aspell-LL packages. I am not sure what could be wrong with the aspell packages; maybe the wordlists are not in UTF-8?

I updated the title of the report, removing Russian, as a user reported success.
Comment 16 Alkis Georgopoulos 2008-10-12 10:56:19 UTC
Confirming for Evolution 2.24.0-0ubuntu2 (Intrepid).

Are there any other gtkhtml applications to see if the bug happens on them also?
Because aspell works fine in gedit and all other apps...
Comment 17 Alkis Georgopoulos 2008-10-12 16:24:04 UTC
OK, I got something:

I start writing a new message, and I only check the Greek dictionary from the edit -> current languages menu.

I write the following five words:
αβγα stαβγα αβγαnd stαβγαnd

All the words are misspelled and get a red wavy underline.

Now, if I click anywhere upon Greek letters (αβγα) I don't get any spell-related entries in the popup menu.

If I click anywhere upon ***English*** letters (st, nd) I ***do*** get a spelling popup menu.

For stαβγα, the proposed words are αβγατίζω, αβγατίσω, καβγαδίζω, καβγατζή
For αβγαnd, the proposed words are αβγαταίνω, αβγατίζω, αβγατιστής, αβγατίσω
For stαβγαnd, there are no proposed words, but there ***are*** spell related menu items like "add this word to the dictionary" etc.


So the problem probably is in the right-click menu logic, which doesn't understand that there is a spelling error if Greek characters are below the mouse cursor. It probably only checks for ASCII letters and doesn't call any is_alpha() UTF-8 aware function.


If I press F7 (=spell check), I only get suggestions for the last 2 words, αβγαnd and stαβγαnd.
So the bug is there too, and it only checks for non-ASCII letters before the english characters, not after.
Another minor note, in the 3rd word, while the spell checker dialog header correctly prompts "Suggestions for αβγαnd", the region highlighter in the editor window (=gtkhtml) is "αβγαnd st" (it also highlights the first two letters of the fourth word).
But, weird thing, if I press alt-tab twice (to un-focus and re-focus evolution), the correct "αβγαnd" gets highlighted!


Hope this helps in debugging.

Kind regards,
Alkis Georgopoulos
Comment 18 Alkis Georgopoulos 2008-10-12 19:49:43 UTC
More info: as far as I can see, it does this when I click in *any* special character, even German letters with umlauts.

E.g. if I write Hööörz, and I click on the middle ö, there's no spell-suggestion entries in the popup menu,
but if I click in "H" or in "rz", I do see spell suggestions.


If I save the message, I see that Hööörz gets written as Hööörz.
It shouldn't be so, because it's a UTF-8 encoded file.

Maybe this is what's wrong here too? E.g. g_unichar_isalpha() in function html_selection_spell_word() in htmlselection.c would return false if the characters passed weren't UTF-8 but html numeric character references like "&#246".
Comment 19 Alkis Georgopoulos 2008-10-13 08:07:05 UTC
I got something more specific:

In the following characters, I mean that if I write a letter with all cyrillic "а", like "ааааааа", and right click on it, I don't see a spell suggestion.

Cyrillic а = U+0430 => no suggestion
Cyrillic р = U+0440 => no suggestion
Cyrillic ф = U+0444 => suggestion

Look at the least significant bytes.
ASCII 30 = character 0 => not a letter
ASCII 40 = character @ => not a letter
ASCII 44 = character D => it's a letter

The same happens with Greek, i.e. the least significant byte is not an ASCII letter.

So this explains everything, somewhere in the code a non-utf-8 aware function (or part of code) is used.
Comment 20 André Klapper 2008-10-13 21:58:59 UTC
*** Bug 556170 has been marked as a duplicate of this bug. ***
Comment 21 Alkis Georgopoulos 2008-10-16 13:22:15 UTC
Another way to encounter this bug, to make it easier for debugging:

1) Paste the following in a new mail:
aaa
αααaaa
aaaααα
αααaaaαααaaaααα
aaa

2) Press F7 to start spell checking and try playing with the "Skip" and "Back" buttons.
In forward checking, it bypasses the 3rd and 4th word.
In backwards checking, it bypasses the 4th and 2nd word.

So the bug happens when the least significant byte of the last character of the word in the direction of spell scanning is not an ASCII letter.


I think gtkhtml uses utf8 internally, but the bug happens when the least significant byte of the *UTF-32* representation is not an ASCII letter.
So I think that the bug happens somewhere where characters are converted to gunichars.


I tried to make a small gtkhtml test application to debug this, but I couldn't find any recent information on how to compile an application that uses gtkhtml...
Comment 22 Matthew Barnes 2008-12-12 04:09:44 UTC
(In reply to comment #21)
> I tried to make a small gtkhtml test application to debug this, but I couldn't
> find any recent information on how to compile an application that uses
> gtkhtml...

Confirming this behavior in GtkHTML 3.25.2.

If you compile GtkHTML from source, there's a small test editor program you can use to debug this more easily: gtkhtml/components/editor/gtkhtml-editor-test
Comment 23 pminos 2009-10-10 21:29:50 UTC
Created attachment 145228 [details] [review]
Reenable spelling suggestions for words containing Non-ASCII Characters
Comment 24 pminos 2009-10-10 21:31:29 UTC
Spelling suggestion for Greek words have been stopped working for several months because in the file "gtkhtml/htmlengine.c", function "html_engine_spell_word_is_valid", the following code returns a gunichar but the result is truncated to gchar.

prev = html_cursor_get_prev_char (e->cursor);
curr = html_cursor_get_current_char (e->cursor);

This means that the spelling suggestions should stop working for all words that contain Non-ASCII Characters.

the local variables gchar prev, curr;
must be replaced by gunichar prev, curr;

I have tested this on Ubuntu 9.04 (jaunty) and it seems to work.
Comment 25 Matthew Barnes 2009-10-10 22:07:38 UTC
Excellent catch!

Patch is definitely correct, but I'm having trouble verifying whether it completely solves the bug report.  I'll add this for 2.28.1 and hopefully someone can verify the fix.

http://git.gnome.org/cgit/gtkhtml/commit/?h=gnome-2-28&id=f92e873c4a41cd5dbe9377a223047f457ba867cd
Comment 26 Yotam Benshalom 2009-10-10 22:12:23 UTC
The patch solved the problem for me with Hebrew (Ubuntu 9.10).
It did not solve the problem of spell checking not working when Hebrew and another language are marked simultaneously, but this is another bug. When only Hebrew is marked, I get correct spelling suggestions.
Comment 27 André Klapper 2017-02-09 13:37:38 UTC
GtkHtml is not under active development anymore. 
Evolution (its main consumer) switched to a WebKit backend a while ago. 
It is currently unlikely that there will be any further GtkHtml development.

Closing this report as WONTFIX as part of Bugzilla Housekeeping (bug 778387) to reflect reality. Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again.