Show
Ignore:
Timestamp:
2007-03-06 18:13:14 (21 months ago)
Author:
Alain Bench <veronatif@…>
Branch:
HEAD
Message:

Remove buggy usage of M_ICONV_HOOK_TO flag in mutt_idna.c:mutt_idna_to_local().
Wipe unwanted code depending on M_ICONV_HOOK_TO in charset.c:mutt_iconv_open().
Totally wipe M_ICONV_HOOK_TO symbol.
Remove misusages of M_ICONV_HOOK_FROM flag in:

  • crypt-gpgme.c:print_utf8().
  • mutt_idna.c:mutt_idna_to_local() and mutt_local_to_idna().
  • pgp.c:pgp_traditional_encryptsign().

Document usage policy of M_ICONV_HOOK_FROM flag.
Cosmetic downcasing of some constant charset names (utf-8, euc-jp) for consistency.
Correction of a typo in the "iso8859-5" charset name.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • charset.c

    r4961 r4963  
    130130  { "ISO_8859-5",       "iso-8859-5"    }, 
    131131  { "cyrillic",         "iso-8859-5"    }, 
    132   { "csISOLatinCyrillic", "iso8859-5"   }, 
     132  { "csISOLatinCyrillic", "iso-8859-5"  }, 
    133133 
    134134  { "ISO_8859-9:1989",  "iso-8859-9"    }, 
     
    151151   
    152152  { "Extended_UNIX_Code_Packed_Format_for_Japanese", 
    153                         "EUC-JP"        }, 
     153                        "euc-jp"        }, 
    154154  { "csEUCPkdFmtJapanese",  
    155                         "EUC-JP"        }, 
     155                        "euc-jp"        }, 
    156156   
    157157  { "csGB2312",         "gb2312"        }, 
     
    322322 * charset-hooks, recanonicalises, and finally applies iconv-hooks. 
    323323 * Parameter flags=0 skips charset-hooks, while M_ICONV_HOOK_FROM 
    324  * applies them to fromcode. 
     324 * applies them to fromcode. Callers should use flags=0 when fromcode 
     325 * can safely be considered true, either some constant, or some value 
     326 * provided by the user; M_ICONV_HOOK_FROM should be used only when 
     327 * fromcode is unsure, taken from a possibly wrong incoming MIME label, 
     328 * or such. Misusing M_ICONV_HOOK_FROM leads to unwanted interactions 
     329 * in some setups. Note: By design charset-hooks should never be, and 
     330 * are never, applied to tocode. Highlight note: The top-well-named 
     331 * M_ICONV_HOOK_FROM acts on charset-hooks, not at all on iconv-hooks. 
    325332 */ 
    326333 
     
    336343  /* transform to MIME preferred charset names */ 
    337344  mutt_canonical_charset (tocode1, sizeof (tocode1), tocode); 
    338  
    339 #ifdef M_ICONV_HOOK_TO 
    340   /* Not used. */ 
    341   if ((flags & M_ICONV_HOOK_TO) && (tmp = mutt_charset_hook (tocode1))) 
    342     mutt_canonical_charset (tocode1, sizeof (tocode1), tmp); 
    343 #endif 
    344  
    345345  mutt_canonical_charset (fromcode1, sizeof (fromcode1), fromcode); 
    346346 
     
    439439/* 
    440440 * Convert a string 
    441  * Used in rfc2047.c and rfc2231.c 
     441 * Used in rfc2047.c, rfc2231.c, crypt-gpgme.c, mutt_idna.c, and more. 
     442 * Parameter flags is given as-is to mutt_iconv_open(). See there 
     443 * for its meaning and usage policy. 
    442444 */ 
    443445 
     
    512514}; 
    513515 
     516/* 
     517 * Parameter flags is given as-is to mutt_iconv_open(). See there 
     518 * for its meaning and usage policy. 
     519 */ 
    514520FGETCONV *fgetconv_open (FILE *file, const char *from, const char *to, int flags) 
    515521{