Show
Ignore:
Timestamp:
2003-03-03 06:01:06 (6 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

IDN support for e-mail messages. Things should work automagically
once you have the GNU IDN library available from
ftp://alpha.gnu.org/pub/gnu/libidn/ installed. For IDN's which
can't be losslessly recoded to your local character set, mutt should
automatically fall back to using the ASCII representation. There's
probably a considerable number of bugs in this, and the code may, at
this point, not even compile on machines without libidn. Will start
working on that ASAP.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • compose.c

    r3267 r3311  
    1919#include "mutt.h" 
    2020#include "mutt_curses.h" 
     21#include "mutt_idna.h" 
    2122#include "mutt_menu.h" 
    2223#include "rfc1524.h" 
     
    364365 
    365366  buf[0] = 0; 
    366   rfc822_write_address (buf, sizeof (buf), addr); 
     367  rfc822_write_address (buf, sizeof (buf), addr, 1); 
    367368  mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]); 
    368369  mutt_paddstr (W, buf); 
     
    400401{ 
    401402  char buf[HUGE_STRING] = ""; /* needs to be large for alias expansion */ 
    402  
    403   rfc822_write_address (buf, sizeof (buf), *addr); 
     403  char *err = NULL; 
     404   
     405  mutt_addrlist_to_local (*addr); 
     406  rfc822_write_address (buf, sizeof (buf), *addr, 0); 
    404407  if (mutt_get_field (Prompts[line - 1], buf, sizeof (buf), M_ALIAS) == 0) 
    405408  { 
     
    415418  } 
    416419 
     420  if (mutt_addrlist_to_idna (*addr, &err) != 0) 
     421  { 
     422    mutt_error (_("Warning: '%s' is a bad IDN."), err); 
     423    mutt_refresh(); 
     424    FREE (&err); 
     425  } 
     426 
    417427  /* redraw the expanded list so the user can see the result */ 
    418428  buf[0] = 0; 
    419   rfc822_write_address (buf, sizeof (buf), *addr); 
     429  rfc822_write_address (buf, sizeof (buf), *addr, 1); 
    420430  move (line, HDR_XOFFSET); 
    421431  mutt_paddstr (W, buf); 
    422  
     432   
    423433  return 0; 
    424434} 
     
    693703            (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS))) 
    694704        { 
     705          char *tag = NULL, *err = NULL; 
     706          mutt_env_to_local (msg->env); 
    695707          mutt_edit_headers (NONULL (Editor), msg->content->filename, msg, 
    696708                             fcc, fcclen); 
     709          if (mutt_env_to_idna (msg->env, &tag, &err)) 
     710          { 
     711            mutt_error (_("Bad IDN in \"%s\": '%s'"), tag, err); 
     712            FREE (&err); 
     713          } 
    697714        } 
    698715        else