Error in Hangul composition code

From: Marcin 'Qrczak' Kowalczyk (qrczak@knm.org.pl)
Date: Sun Jul 04 2004 - 14:44:19 CDT

  • Next message: Patrick Andries: "[OT] Dutch letters was [Fwd: Re: is "n with tilde" used in French language ?]"

    <http://www.unicode.org/reports/tr15/> says:

                int SIndex = last - SBase;
                if (0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0) {
                    int TIndex = ch - TBase;
                    if (0 <= TIndex && TIndex <= TCount) {

                        // make syllable of form LVT

                        last += TIndex;
                        result.setCharAt(result.length()-1, last); // reset last
                        continue; // discard ch
                    }
                }

    But there is no character at TBase == U+11A7. TBase is put one code
    point below the first trailing consonant, because TIndex == 0 as
    computed from SIndex % TCount generally means that there is no trailing
    consonant.

    Also, the character at TBase + TCount doesn't compose with LV. Adding
    a count to a base points to the first code point *after* the range.

    So the condition should be if (0 < TIndex && TIndex < TCount).

    -- 
       __("<         Marcin Kowalczyk
       \__/       qrczak@knm.org.pl
        ^^     http://qrnik.knm.org.pl/~qrczak/
    


    This archive was generated by hypermail 2.1.5 : Mon Jul 05 2004 - 11:02:55 CDT