#include /* if you want to build the charset map, add the root directory of libunicode to the include path and define BUILD_MAP, then run it as ./a.out > camel-charset-map-private.h The tables genereated work like this: An indirect array for each page of unicode character Each array element has an indirect pointer to one of the bytes of the generated bitmask. */ #ifdef BUILD_MAP #include "iso/iso8859-2.h" #include "iso/iso8859-3.h" #include "iso/iso8859-4.h" #include "iso/iso8859-5.h" #include "iso/iso8859-6.h" #include "iso/iso8859-7.h" #include "iso/iso8859-8.h" #include "iso/iso8859-9.h" #include "iso/iso8859-10.h" #include "iso/iso8859-13.h" #include "iso/iso8859-14.h" #include "iso/iso8859-15.h" #include "iso/windows-1250.h" #include "iso/windows-1252.h" #include "iso/windows-1257.h" #include "iso/koi8-r.h" #include "iso/koi8-u.h" #include "iso/tis620.2533-1.h" #include "iso/armscii-8.h" #include "iso/georgian-academy.h" #include "iso/georgian-ps.h" #include "msft/cp932.h" #include "jis/shiftjis.h" static struct { unsigned short *table; char *name; int type; /* type of table */ unsigned int bit; /* assigned bit */ } tables[] = { { iso8859_2_table, "iso-8859-2", 0, 0} , { iso8859_3_table, "iso-8859-3", 0, 0} , { iso8859_4_table, "iso-8859-4", 0, 0}, { iso8859_5_table, "iso-8859-5", 0, 0}, /* apparently -6 has special digits? */ { iso8859_6_table, "iso-8859-6", 0, 0}, { iso8859_7_table, "iso-8859-7", 0, 0}, { iso8859_8_table, "iso-8859-8", 0, 0}, { iso8859_9_table, "iso-8859-9", 0, 0}, { iso8859_10_table, "iso-8859-10", 0, 0}, { iso8859_13_table, "iso-8859-13", 0, 0}, { iso8859_14_table, "iso-8859-14", 0, 0}, { iso8859_15_table, "iso-8859-15", 0, 0}, { windows_1250_table, "windows-1250", 0, 0}, { windows_1252_table, "windows-1252", 0, 0}, { windows_1257_table, "windows-1257", 0, 0}, { koi8_r_table, "koi8-r", 0, 0}, { koi8_u_table, "koi8-u", 0, 0}, { tis_620_table, "tis620.2533-1", 0, 0}, { armscii_8_table, "armscii-8", 0, 0}, { georgian_academy_table, "georgian-academy", 0, 0}, { georgian_ps_table, "georgian-ps", 0, 0}, { cp932_table, "CP932", 1, 0}, { sjis_table, "Shift-JIS", 1, 0}, { 0, 0} }; unsigned int encoding_map[256 * 256]; static void add_bigmap(unsigned short **table, int bit) { int i; int j; for (i=0;i<256;i++) { unsigned short *tab = table[i]; if (tab) { for (j=0;j<256;j++) { if (tab[j]) encoding_map[tab[j]] |= bit; } } } } void main(void) { int i, j; unsigned short *tab; int max, min; int bit = 0x01; int k; int bytes; #if 0 /* iso-latin-1 (not needed-detected in code) */ for (i=0;i<256;i++) { encoding_map[i] |= bit; } bit <<= 1; #endif /* dont count the terminator */ bytes = ((sizeof(tables)/sizeof(tables[0]))+7-1)/8; /* the other latin charsets */ for (j=0;tables[j].table;j++) { switch (tables[j].type) { case 0: /* table from 128-256 */ tab = tables[j].table; for (i=0;i<128;i++) { /* 0-127 is the common */ encoding_map[i] |= bit; encoding_map[tab[i]] |= bit; } break; case 1: /* sparse table */ add_bigmap(tables[j].table, bit); break; } tables[j].bit = bit; bit <<= 1; } printf("/* This file is automatically generated: DO NOT EDIT */\n\n"); for (i=0;i<256;i++) { /* first, do we need this block? */ for (k=0;k> (k*8)) & 0xff ); if (((j+1)&7) == 0 && j<255) printf("\n\t"); } printf("\n};\n\n"); } } } printf("struct {\n"); for (k=0;k>8].bits%d?camel_charmap[(x)>>8].bits%d[(x)&0xff]<<%d:0)", k, k, k*8); if (k #include void camel_charset_init(CamelCharset *c) { c->mask = ~0; c->level = 0; } void camel_charset_step(CamelCharset *c, const char *in, int len) { register unsigned int mask; register int level; const char *inptr = in, *inend = in+len; mask = c->mask; level = c->level; /* check what charset a given string will fit in */ while (inptr < inend) { unicode_char_t c; const char *newinptr; newinptr = unicode_get_utf8(inptr, &c); if (newinptr == NULL) { inptr++; continue; } inptr = newinptr; if (c<=0xffff) { mask &= charset_mask(c); if (c>=128 && c<256) level = MAX(level, 1); else if (c>=256) level = MAX(level, 2); } else { mask = 0; level = MAX(level, 2); } } c->mask = mask; c->level = level; } /* gets the best charset from the mask of chars in it */ static const char * camel_charset_best_mask(unsigned int mask) { int i; for (i=0;ilevel == 1) return "ISO-8859-1"; else if (charset->level == 2) return camel_charset_best_mask(charset->mask); else return NULL; } /* finds the minimum charset for this string NULL means US-ASCII */ const char * camel_charset_best(const char *in, int len) { CamelCharset charset; camel_charset_init(&charset); camel_charset_step(&charset, in, len); return camel_charset_best_name(&charset); } #endif /* !BUILD_MAP */ n class='deletions'>-1/+8 * Removed. Nothing uses this interface (which didn't use the EError routinesJeffrey Stedfast2004-05-223-51/+6 * Added a workaround for broken IMAP. Hopefully by forcing only the IMAP4Jeffrey Stedfast2004-05-222-1/+38 * Updated Czech translation.Miloslav Trmac2004-05-212-349/+388 * remove unused.Not Zed2004-05-212-1/+4 * set a default error parent fallback. (e_error_newv): if parent is null,Not Zed2004-05-213-0/+39 * add marshaller for p_ppppp call.Not Zed2004-05-218-69/+144 * added a 'domain' argument, and rearragned arguments to be prettier andNot Zed2004-05-2114-109/+129 * re-arrange the code so exception debug will print the expandedNot Zed2004-05-217-36/+57 * finally put the 1.2 password upgrade patch in. Untested. #42721.Not Zed2004-05-212-1/+102 * add "Select certificate" title to the previously untitled dialog.Jon Oberheide2004-05-212-0/+6 * Add helper func. (process_item_fn): Add undisplayed fields to notes.Hans Petter Jansson2004-05-213-0/+70 * Implement. (migrate_contacts_hidden_fields): Implement.Hans Petter Jansson2004-05-212-0/+85 * Fixes for bug #57305.Jeffrey Stedfast2004-05-214-10/+27 * proper look for figuring out if the object is on the serverJP Rosevear2004-05-212-9/+8 * Fix for #58738 ja_JP.UTF-8: Evolution crashes when certain ASCII/non-ASCIISuresh Chandrasekharan2004-05-212-3/+13 * Use the activate signal, instead of changed, for the combo boxRodney Dawes2004-05-212-1/+21 * Fixes bug #42295 and the infinite loop part of bug #58766 (these 2 bugsJeffrey Stedfast2004-05-212-22/+41 * use the new ebook api here. missed this one in my earlier commit.Chris Toshok2004-05-212-1/+8 * pass the client properlyJP Rosevear2004-05-212-2/+7 * only unref the mask if there is oneJP Rosevear2004-05-212-1/+7 * finish pages printing by gnome_print_job_close call before showing previewRadek Doulik2004-05-212-0/+8 * added call to begin page, ref printable and sink it to avoid finalizing ofRadek Doulik2004-05-212-2/+16 * remove "use daemon" handling codeRadek Doulik2004-05-203-48/+228 * Add README and jump.xpmRodney Dawes2004-05-202-0/+6 * Updated Czech translation.Miloslav Trmac2004-05-202-80/+163 * ** See #58388.Not Zed2004-05-202-1/+8 * ** See #57583.Not Zed2004-05-203-8/+43 * Don't crash when the user presses 'cancel'. Fixes #58733.James Willcox2004-05-202-0/+9 * oops, poke the right uid to get the article number.Not Zed2004-05-202-2/+9 * copy the messageinfo rather than reference the source folder's one, weNot Zed2004-05-202-14/+16 * ** See #58693.Not Zed2004-05-204-4/+17 * use the new e_book_new_* and e_book_open apis.Chris Toshok2004-05-203-6/+15 * use the new e_book_new_* and e_book_open apis.Chris Toshok2004-05-203-4/+13 * use the new e_book_new and e_book_open apis.Chris Toshok2004-05-2012-45/+108 * Check if individual email fields are supported.Hans Petter Jansson2004-05-202-0/+9 * Updated British English translationGareth Owen2004-05-202-222/+234 * Remove debug output. (real_save_contact): Separate out actual save logicHans Petter Jansson2004-05-203-14/+113 * don't build the WWxHH subdirs yetJeffrey Stedfast2004-05-201-2/+0 * Setup the icon install paths (not that we actually use them yet).Jeffrey Stedfast2004-05-202-2/+22 * didn't need these eitherJeffrey Stedfast2004-05-203-5/+2 * guess these icons weren't needed afterall.Jeffrey Stedfast2004-05-203-5/+2 * Fixed the icon name to get the right one.Jeffrey Stedfast2004-05-202-1/+3 * added .cvsignoreJeffrey Stedfast2004-05-201-0/+2 * added 16x16 and 48x48 subdirsJeffrey Stedfast2004-05-208-0/+16 * Fixes a number of bugs, adds some unimplemented functionality, and makesHans Petter Jansson2004-05-203-913/+1026 * doh. need to append ".png" to the icon filenames when falling back on looking...Jeffrey Stedfast2004-05-201-2/+2 * Lots of re-working action. We no longer load a pixbuf for each and everyJeffrey Stedfast2004-05-203-98/+186 * Changed to load an empty pixbuf manually rather than relying on the pixbufJeffrey Stedfast2004-05-202-22/+34 * New file explaining how to add icons to the build, etc.Jeffrey Stedfast2004-05-20282-4259/+291 * bump versionJP Rosevear2004-05-2051-130402/+162518 * Updated Catalan translation by Xavier Conde Rueda <xaviconde@eresmas.com>.Jordi Mallach2004-05-202-3667/+4639 * don't dist the error .h fileJP Rosevear2004-05-202-1/+4 * don't dist the error .h fileJP Rosevear2004-05-206-3/+13 * We always have GnomeIconTheme nowadays, get rid of the old unused code.Jeffrey Stedfast2004-05-192-55/+29 * Updated Czech translation.Miloslav Trmac2004-05-192-207/+274 * make exchange accounts insensitve.Larry Ewing2004-05-191-1/+4 * use the article number instead of the messageid. Some servers are justNot Zed2004-05-193-15/+33 * if we end up with an application/octet-stream part, pre-snoop it so we setNot Zed2004-05-196-80/+97 * make this match the efhd stuff.Not Zed2004-05-193-10/+28 * use the menu icon not the button icon for the menus. (setup_widgets):Not Zed2004-05-194-6/+101 * Add menu_label and menu_accelerator.William Jon McCann2004-05-192-0/+7 * Add menu_label and menu_accelerator.William Jon McCann2004-05-192-0/+7 * Add menu_label and menu_accelerator.William Jon McCann2004-05-192-0/+9 * Added View->Window menu.Not Zed2004-05-192-0/+5 * ** See #58641.Not Zed2004-05-193-2/+19 * fixed up the empty trash on exit thing, to update for all stores, notNot Zed2004-05-192-13/+21 * Added header "X-Newsreader" for handle Outlook Express as Mailer.Cantona Su2004-05-192-1/+7 * pass 0 to eab_send_contact. (file_send_to_cb): same.Chris Toshok2004-05-192-2/+8 * split out the DISPOSITION_AS_TO stuff here, and make it take a GList ofChris Toshok2004-05-194-171/+325 * Fixes #57940Jerome Lacoste2004-05-192-3/+10 * Fixes bug #57940Jerome Lacoste2004-05-192-2/+8 * Updated Czech translation.Miloslav Trmac2004-05-182-344/+359 * add argJP Rosevear2004-05-185-14/+63 * just set up the alarm notify objectJP Rosevear2004-05-189-233/+251 * set the default for exit-unsaved to save, as in 1.4. #57995.Not Zed2004-05-182-1/+4