Re: [Mailer] Fix for #333698
"simon.zheng" <[email protected]>
| Newsgroups | gmane.comp.gnome.evolution.patches |
|---|---|
| Message-ID | <1141785762.16861.5.camel@fulltime> |
Thanks, Jeff, Resending the patch. Changing guint32 to gunichar. Regard, -Simon On Tue, 2006-03-07 at 11:11 -0500, Jeffrey Stedfast wrote: > My only suggestion would be to use gunichar instead of guint32 > > Jeff > > On Tue, 2006-03-07 at 16:00 +0800, simon.zheng wrote: > > Hi, > > > > Bug #333698 - Evolution can't find mails with some localized subject on > > Solaris sparc. > > http://bugzilla.gnome.org/show_bug.cgi?id=333698 > > > > To avoid break the complete utf8 characters, we should traverse strings > > by utf8 character order rather than one by one byte. > > > > Sending patch for review. > > > > Thanks, > > -Simon > > _______________________________________________ > > Evolution-patches mailing list > > [email protected] > > http://mail.gnome.org/mailman/listinfo/evolution-patches _______________________________________________ Evolution-patches mailing list [email protected] http://mail.gnome.org/mailman/listinfo/evolution-patches
updated_333698-header-match.diff
(text/x-patch, 2.3 KB)
Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v retrieving revision 1.2526 diff -u -p -r1.2526 ChangeLog --- ChangeLog 21 Feb 2006 12:17:27 -0000 1.2526 +++ ChangeLog 8 Mar 2006 02:26:53 -0000 @@ -1,3 +1,12 @@ +2006-03-08 Simon Zheng <[email protected]> + + ** Fixes bug #333698 + + * camel-search-private.c (header_match): + (camel_search_header_match): + To traverse strings by utf8 char order rather than one by one byte, + use camel_utf8_getc() and other utf8-specific routines instead. + 2006-02-21 Rohini S <[email protected]> ** See bug 318697 Index: camel-search-private.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/camel-search-private.c,v retrieving revision 1.36 diff -u -p -r1.36 camel-search-private.c --- camel-search-private.c 6 Dec 2005 04:21:54 -0000 1.36 +++ camel-search-private.c 8 Mar 2006 02:26:53 -0000 @@ -368,6 +368,7 @@ header_match(const char *value, const ch { const unsigned char *p; int vlen, mlen; + gunichar c; if (how == CAMEL_SEARCH_MATCH_SOUNDEX) return header_soundex (value, match); @@ -380,8 +381,8 @@ header_match(const char *value, const ch /* from dan the man, if we have mixed case, perform a case-sensitive match, otherwise not */ p = (const unsigned char *)match; - while (*p) { - if (isupper(*p)) { + while (c = camel_utf8_getc(&p)) { + if (g_unichar_isupper(c)) { switch (how) { case CAMEL_SEARCH_MATCH_EXACT: return strcmp(value, match) == 0; @@ -396,7 +397,6 @@ header_match(const char *value, const ch } return FALSE; } - p++; } switch (how) { @@ -420,13 +420,15 @@ header_match(const char *value, const ch gboolean camel_search_header_match (const char *value, const char *match, camel_search_match_t how, camel_search_t type, const char *default_charset) { - const char *name, *addr; + const char *name, *addr, *ptr; int truth = FALSE, i; CamelInternetAddress *cia; char *v, *vdom, *mdom; + gunichar c; - while (*value && isspace (*value)) - value++; + ptr = value; + while ((c = camel_utf8_getc((const unsigned char **)&ptr)) && g_unichar_isspace(c)) + value = ptr; switch(type) { case CAMEL_SEARCH_TYPE_ENCODED: