[bt-devel] cyrillification attempt

Nikolay Igotti bt-devel@crosswire.org
Thu, 22 Aug 2002 00:58:51 -0700 (PDT)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1853773658-785884497-1030003131=:9090
Content-Type: TEXT/PLAIN; charset=US-ASCII

 Recently I joined BibleTime development team, and one of my important 
goals is cyrillification of books names. I created proper ru.cfg
(see attachment) but it failed. When I realized reasons, I decided to
discuss it here.
 src/keys/versekey.cpphas following method:
int VerseKey::getBookAbbrev(const char *iabbr):
int VerseKey::getBookAbbrev(const char *iabbr)
{
    int loop, diff, abLen, min, max, target, retVal = -1;

    char *abbr = 0;

        stdstr(&abbr, iabbr);
        strstrip(abbr);
        toupperstr(abbr);

 toupperstr is implemented like this
char *toupperstr(char *buf) {
        char *ret = buf;

        while (*buf)
                *buf = SW_toupper(*buf++);

        return ret;
}
and SW_toupper is just table lookup macro.
For KOI8 (standard russian UNIX charset) this table lookup returns 
incorrect values (no wonder here). And computing abbreviations for
book names we end up getting bad values. Quick fix would be use ICU
functionality, maybe better would be to get rid of book name lookups and
use book numbers.

 Nikolay.


---1853773658-785884497-1030003131=:9090
Content-Type: APPLICATION/octet-stream; name="ru.conf"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0208220058510.9090@mozz.sfbay.sun.com>
Content-Description: 
Content-Disposition: attachment; filename="ru.conf"

W01ldGFdCk5hbWU9cnUKRGVzY3JpcHRpb249UnVzc2lhbgoKW1RleHRdCkdl
bmVzaXM94tnUycUKRXhvZHVzPenTyM/ECkxldml0aWN1cz3sxdfJ1ApOdW1i
ZXJzPf7J08zBCkRldXRlcm9ub215PffUz9LP2sHLz87JxQpKb3NodWE96cnT
1dMg7sHXyc4KSnVkZ2VzPfPVxNjJClJ1dGg98tXG2ApJIFNhbXVlbD0xLdEg
48HS09TXCklJIFNhbXVlbD0yLdEg48HS09TXCkkgS2luZ3M9My3RIOP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