[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Operator recognition problems with Turkish locale



Hi list,

When using McKoi with a Turkish locale, the internal queries that
create the views don't work, and the database doesn't start. 

The reason is that they are written in upper case, and McKoi's
Operator.get methods converts the keywords to lower case to recognise
them. 

The Turkish locale is particular in that the lower case of 'I'
isn't 'i', but rather what we'd render as 'ý', and as a result the 'IN',
'IS', 'IS NOT', 'NOT IN', 'LIKE' and 'NOT LIKE' operators are not
recognised.

The fix is to convert to upper case instead
(/com/mckoi/database/Operator.java line 348):

    // Operators that are words, convert to upper case...
    // Upper case to avoid the Turkish locale problem [sae]
    op = op.toUpperCase();
    if (op.equals("IS")) { return is_op; }
    else if (op.equals("IS NOT")) { return isn_op; }
    else if (op.equals("LIKE")) { return like_op; }
    else if (op.equals("NOT LIKE")) { return nlike_op; }
    else if (op.equals("REGEX")) { return regex_op; }

    else if (op.equals("IN")) { return in_op; }
    else if (op.equals("NOT IN")) { return nin_op; }

    else if (op.equals("NOT")) { return not_op; }
    else if (op.equals("AND")) { return and_op; }
    else if (op.equals("OR")) { return or_op; }


Take care,

-- 
Stefaan
-- 
As complexity rises, precise statements lose meaning,
and meaningful statements lose precision. -- Lotfi Zadeh