Changeset 5376a95 for fmtext.c


Ignore:
Timestamp:
Dec 28, 2007, 5:04:34 PM (13 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
6201646
Parents:
925e122
Message:
First pass at incoming zephyr -> UTF-8 sanitizing.
This only operates on incoming data so far.
We still need to clean outgoing data -- the plan is to attempt conversion
to ISO-8859-1, and use that if it works.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r9866c3a r5376a95  
    235235char *owl_fmtext_print_plain(owl_fmtext *f)
    236236{
    237   char *r, *s, *p;
    238   r = owl_malloc(f->bufflen);
    239   r[0] = '\0';
    240   s = f->textbuff;
    241   /* Find next possible format character. */
    242   p = strchr(s, OWL_FMTEXT_UC_STARTBYTE_UTF8);
    243   while(p) {
    244     /* If it's a format character, copy up to it, and skip all
    245        immediately following format characters. */
    246     if (_owl_fmtext_is_format_char(g_utf8_get_char(p))) {
    247       strncat(r, s, p-s);
    248       p = g_utf8_next_char(p);
    249       while (p && _owl_fmtext_is_format_char(g_utf8_get_char(p))) {
    250         p = g_utf8_next_char(p);
    251       }
    252       s = p;
    253       p = strchr(s, OWL_FMTEXT_UC_STARTBYTE_UTF8);
    254     }
    255     else {
    256       p = strchr(p+1, OWL_FMTEXT_UC_STARTBYTE_UTF8);
    257     }
    258   }
    259   if (s) strcat(r,s);
    260   return(r);
     237  return owl_strip_format_chars(f->textbuff);
    261238}
    262239
Note: See TracChangeset for help on using the changeset viewer.