Ticket #2743: utf8-search.patch

File utf8-search.patch, 645 bytes (added by boris, 9 years ago)
  • lib/search/regex.c

    a b  
    722722        mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp); 
    723723        g_string_free (tmp, TRUE); 
    724724    } 
     725 
     726    GRegexCompileFlags g_regex_options = G_REGEX_OPTIMIZE | G_REGEX_DOTALL; 
     727    if (!(str_isutf8 (charset) && mc_global.utf8_display)) 
     728        g_regex_options |= G_REGEX_RAW; 
     729 
    725730    mc_search_cond->regex_handle = 
    726         g_regex_new (mc_search_cond->str->str, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_DOTALL, 
     731        g_regex_new (mc_search_cond->str->str, g_regex_options, 
    727732                     0, &mcerror); 
    728733 
    729734    if (mcerror != NULL)