From: Matthias Clasen Date: Fri, 23 Mar 2007 00:17:10 +0000 (+0000) Subject: Fix corner-cases of upper/lowercase conversion. (#418217, Denis Jacquerye) X-Git-Tag: GLIB_2_13_1~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7296a345716476f449e69dc800fd4ee3e82e44b5;p=platform%2Fupstream%2Fglib.git Fix corner-cases of upper/lowercase conversion. (#418217, Denis Jacquerye) 2007-03-22 Matthias Clasen * glib/guniprop.c: Fix corner-cases of upper/lowercase conversion. (#418217, Denis Jacquerye) svn path=/trunk/; revision=5433 --- diff --git a/ChangeLog b/ChangeLog index 9233bff3d..3c13588d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-22 Matthias Clasen + + * glib/guniprop.c: Fix corner-cases of upper/lowercase conversion. + (#418217, Denis Jacquerye) + 2007-03-22 Chris Wilson * glib/gkeyfile.c: Track whether the last key=value pair in a group diff --git a/glib/guniprop.c b/glib/guniprop.c index 908d3fe18..702903761 100644 --- a/glib/guniprop.c +++ b/glib/guniprop.c @@ -546,15 +546,13 @@ g_unichar_toupper (gunichar c) if (val >= 0x1000000) { const gchar *p = special_case_table + val - 0x1000000; - return g_utf8_get_char (p); - } - else - { - /* Some lowercase letters, e.g., U+000AA, FEMININE ORDINAL INDICATOR, - * do not have an uppercase equivalent, in which case val will be - * zero. */ - return val ? val : c; + val = g_utf8_get_char (p); } + /* Some lowercase letters, e.g., U+000AA, FEMININE ORDINAL INDICATOR, + * do not have an uppercase equivalent, in which case val will be + * zero. + */ + return val ? val : c; } else if (t == G_UNICODE_TITLECASE_LETTER) { @@ -629,9 +627,11 @@ g_unichar_totitle (gunichar c) || title_table[i][2] == c) return title_table[i][0]; } - return (TYPE (c) == G_UNICODE_LOWERCASE_LETTER - ? ATTTABLE (c >> 8, c & 0xff) - : c); + + if (TYPE (c) == G_UNICODE_LOWERCASE_LETTER) + return g_unichar_toupper (c); + + return c; } /**