Re: Patch: new Gnome Spelling Dialog + Please Help


Subject: Re: Patch: new Gnome Spelling Dialog + Please Help
From: Vlad Harchev (hvv@hippo.ru)
Date: Thu Oct 12 2000 - 08:33:51 CDT


On Thu, 12 Oct 2000, Vlad Harchev wrote:

> On Thu, 12 Oct 2000, Martin Sevior wrote:
>
> Hi,
>
> I'm very sorry for so late reply.
> Yes, megapatch did tweak the ispell code, but I didn't change anything in
> Dialog logic and other functions (though I reimplemented
> "UT_is{aplha,lower,upper}" correctly).
>
> I tested basic spellchecking functionality with american and russian
> dictionaries and it worked fine on my RH6.0.
> Here is a description of a change I made to ispell (newMain.c) that matter:
>
> The old ispell was trying to convert from unicode to dictionary's encoding
> incorrectly. First of all, it tried to use "UCS-2-INTERNAL" encoding as
> argument to iconv. This encoding is unknown to iconv in glibc, so the pieces
> of code (that recodes from unicode to dictionary's charset) were never
> executed before. So I added
>
> #ifndef __GLIBC__
> # define UCS_2_INTERNAL "UCS-2-INTERNAL"
> #else
> # define UCS_2_INTERNAL "UCS-2"
> #endif
>
> and used UCS_2_INTERNAL everywhere "UCS-2-INTERNAL" was used. So, due to this
> change, iconv was really engaged in recoding ( condition
> (translate_in == (iconv_t)-1)
> became 'false', same for 'translate_out').
> Next, UCS-2 encoding assumes that unicode values (shorts) are in MSB order,
> so 2 characters of unicode value should be swapped on x86 and glibc used in
> RH6.0 (and 6.2). Dunno what byte order iconv on RH7 assumes. The attached
> program will help to detect the needed byte order (it prints 'msb' on my
> Rh6.0 and SuSE6.4). What does it print on RH7? On my RH6.0 it prints:
> ------------------
> conversion from "UCS2" to "KOI8-R" OK with 0x3e04 on input and 0xcf on output
> iconv returned 1
> conversion from "UCS2" to "KOI8-R" failed with 0x43e on input
> iconv returned ffffffff
> conversion from "KOI8-R" to "UCS2" OK with 0xcf on input and 0x3e04 on output
> iconv returned 4
> ------------------
> Note last "iconv returned 4": it's a bug in glibc on RH6.0. Interestingly, on
> SuSE6.4 it prints "iconv returned 0" at last (again a bug). As I understand,
> the correct version is "iconv returned 1" since only one character (symbol,
> not 'char') was converted.
> This program tries to convert from 0xcf in koi8-r (cyrillic letter 'o') to
> unicode (unicode value is 0x43e).
> Also, it would interesting to run this program on non x86 and not glibc's
> iconv.
>
> So, I think the only reason for spellchecking logic to fail is that iconv in
> new glibc changed byte order. I think we should produce workaround for this
> (some global variables that tell whether to swap bytes of unicode value on
> input and on output - and these flags should be initialized on startup of AW).
> So, could everybody having problems with spellchecking post the output of this
> program run on their system?

 Just tested this program with libiconv - it can't open any iconv_t - "UCS2"
is unknown to libiconv, so please substitute "UCS2" with "UCS-2" in that
program. When I did that substitution, program gave the same output as when
linking with only glibc on RH6.0 (except that "iconv returned .." strings
changed), so it seems that libiconv can be used with megatpatch
interchangeably.

 Note, my megapatch didn't use "UCS2", it used "UCS-2" everywhere, so
no code in CVS needs to be touched.

 I'm sorry.

> I'm willing to help fixing this problem.
>
> >
> >
> > On Wed, 11 Oct 2000, sam th wrote:
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > On Wed, 11 Oct 2000, Dom Lachowicz wrote:
> > >
> > > > Second: could someone please tell me that the current dialog works? As you
> > > > can see from the screenshot, the dialog is entirely empty on my machine.
> > > > This happened before even before I made any changes to ap_UnixDialog_Spell.
> > > > The funny thing is that it still ignores the correct words when you hit the
> > > > ignore button and changes the word to a sensible value after you hit the
> > > > change button. I put liberal UT_DEBUGMSG(("Current word is: %s", p)); in
> > > > _showMisspelledWord() but all I get is "Current word is: " Is this a
> > > > side-effect of the megapatch or perhaps RH7 is messed up? I don't know. I'd
> > > > appreciate the help or confirmation that my box is fried.
> > >
> > > More info on this bug:
> > >
> > > 1) the problem is actually in _nextMisspelledWord()
> > > 2) pBlockText should have the correct text, but it doesn't
> > > 3) the data should be retrieved from m_pBlockBuf, which also doesn't have
> > > the correct data (AFAICT)
> > > 4) The problem was introduced between 5 AM 10/9 and 5 AM 10/10. Most
> > > likely, it was an effect of Vlad's patch, but I'm not sure yet.
> > >
> >
> > I have a stock RedHat 6.2 install. I just did an cvs update abi and a
> > totally fresh compile. The spell check works for me. Since I applied
> > Vlad's patch to my tree I might have missed doing a CVS add somewhere.
> >
> > BTW I'll add Vlad's Russion strings now, then I'll check to see if I
> > missed a new file.
> >
> > Cheers
> >
> > Martin
> >
> >
>
> Best regards,
> -Vlad
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Thu Oct 12 2000 - 08:51:07 CDT