Changeset 7261


Ignore:
Timestamp:
Dec 3, 2008, 3:59:53 PM (12 years ago)
Author:
charles
Message:

(gtk) #1544: case insensitivity search does not work with non-ascii alphabets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-window.c

    r7123 r7261  
    275275
    276276static int
    277 checkFilterText( filter_text_mode_t filter_text_mode,
    278                  const tr_info *    torInfo,
    279                  const char *      text )
     277checkFilterText( filter_text_mode_t    filter_text_mode,
     278                 const tr_info       * torInfo,
     279                 const char          * text )
    280280{
    281281    tr_file_index_t i;
     
    288288            for( i = 0; i < torInfo->fileCount && !ret; ++i )
    289289            {
    290                 pch = g_ascii_strdown( torInfo->files[i].name, -1 );
     290                pch = g_utf8_casefold( torInfo->files[i].name, -1 );
    291291                ret = !text || strstr( pch, text ) != NULL;
    292292                g_free( pch );
     
    295295
    296296        case FILTER_TEXT_MODE_TRACKER:
    297             pch = g_ascii_strdown( torInfo->trackers[0].announce, -1 );
     297            pch = g_utf8_casefold( torInfo->trackers[0].announce, -1 );
    298298            ret = !text || ( strstr( pch, text ) != NULL );
    299299            g_free( pch );
     
    301301
    302302        default: /* NAME */
    303             pch = g_ascii_strdown( torInfo->name, -1 );
     303            pch = g_utf8_casefold( torInfo->name, -1 );
    304304            ret = !text || ( strstr( pch, text ) != NULL );
    305305            g_free( pch );
     
    355355
    356356    return checkFilterMode( p->filter_mode, tor )
    357            && checkFilterText( p->filter_text_mode, tr_torrentInfo(
    358                                    tor ), p->filter_text );
     357           && checkFilterText( p->filter_text_mode, tr_torrentInfo( tor ), p->filter_text );
    359358}
    360359
     
    426425    pch = gtk_editable_get_chars( e, 0, -1 );
    427426    g_free( p->filter_text );
    428     p->filter_text = g_ascii_strdown( pch, -1 );
     427    p->filter_text = g_utf8_casefold( pch, -1 );
    429428    refilter( p );
    430429    g_free( pch );
Note: See TracChangeset for help on using the changeset viewer.