[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] KSpell Unicode problem (BR#86940)
From:       Lukáš_Tinkl <lukas () kde ! org>
Date:       2005-02-18 13:29:49
Message-ID: 200502181429.49410.lukas () kde ! org
[Download RAW message or body]

Dne pá 18. února 2005 13:03 Lukáš Tinkl napsal(a):
> Dne pá 18. února 2005 12:48 Waldo Bastian napsal(a):
> > On Monday 14 February 2005 17:53, Mashrab Kuvatov wrote:
> > > Hi all,
> > >
> > > could anyone have look at the patch and commit it if everything is
> > > fine? There is some more info on the issue in BR#86940.
> >
> > The code in CVS (with the hack that your patch removes) seems to work
> > just fine with ISpell & UTF8, so the question will be when exactly this
> > hack is needed and when not, in particular whether we can disable it for
> > ASpell in general, or whether we should check for the actual ASpell
> > version.
> >
> > Lukas, can you comment on this?
> >
> > Cheers,
> > Waldo
>
> It seems to work with ASpell6, I'll try the patch with my ASpell + UTF-8.
> If Zack doesn't object, we can commit it IMHO.

Hmmm, unfortunate situation... Mashrab's patch breaks with older aspells, 
that's what I feared. Furthermore, KSpell+ASpell5 currently can't cope with 
any utf8 text at all. Attached patch fixes that.

Some screenshots with explanations:

1) http://developer.kde.org/~lukas/pics/kspell_aspell_utf8.png
This shows my setup with Mashrab's patch only; you can see that neither it 
works with utf8 nor it highligts correctly the misspelled word

2) http://developer.kde.org/~lukas/pics/kspell_aspell_utf8_with_patch.png
This is with both my and Mahrab's patches, utf8 works, highlighting doesn't

3) 
http://developer.kde.org/~lukas/pics/kspell_aspell_utf8_with_my_patch_only.png
This is with my patch only (without Mashrab's stuff), everything works 
correctly :)

What I need is:
- Mashrab to test my patch with aspell6
- someone to advise how to check for aspell's version and then enable 
Mashrab's patch accordingly

Remark: it seems that KSpell handles the encodings correctly with ispell only, 
correct me if I'm wrong.

-- 
Lukáš Tinkl <lukas@kde.org>
KDE developer


ROMEO: Courage, man; the hurt cannot be much. MERCUTIO: No, 'tis not so deep 
as a well, nor so wide as a church- door; but 'tis enough, 'twill serve.

["kspell_aspell_utf8_fix.diff" (text/x-diff)]

? kspell.cpp.diff
? kspell_aspell_utf8_fix.diff
Index: kspell.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kspell.cpp,v
retrieving revision 1.130
diff -u -r1.130 kspell.cpp
--- kspell.cpp	25 Nov 2004 06:28:55 -0000	1.130
+++ kspell.cpp	18 Feb 2005 13:27:53 -0000
@@ -231,7 +231,10 @@
 	kdError(750) << "charsets iso-8859-4 .. iso-8859-15 not supported yet" << endl;
 	break;
       case KS_E_UTF8:
-        *proc << "-Tutf8";
+        if (ksconfig->client() == KS_CLIENT_ISPELL)
+            *proc << "-Tutf8";
+	else
+	    *proc << "--encoding=utf-8";
         break;
       case KS_E_KOI8U:
 	*proc << "-w'"; // add ' as a word char


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic