Changeset 1716:e537695cd77b for compose.c
Legend:
- Unmodified
- Added
- Removed
-
compose.c
r1601 r1716 27 27 #include "sort.h" 28 28 #include "charset.h" 29 #include "iconv.h" 29 30 30 31 #ifdef MIXMASTER … … 68 69 69 70 #define HDR_XOFFSET 10 70 #define TITLE_FMT "%10s" 71 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */ 71 72 #define W (COLS - HDR_XOFFSET) 72 73 … … 278 279 buf[0] = 0; 279 280 rfc822_write_address (buf, sizeof (buf), addr); 280 mvprintw (line, 0, TITLE_FMT "%-*.*s", Prompts[line - 1], W, W, buf); 281 mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]); 282 mutt_paddstr (W, buf); 281 283 } 282 284 … … 287 289 draw_envelope_addr (HDR_CC, msg->env->cc); 288 290 draw_envelope_addr (HDR_BCC, msg->env->bcc); 289 mvprintw (HDR_SUBJECT, 0, TITLE_FMT "%-*.*s", Prompts[HDR_SUBJECT - 1], W, W,290 NONULL(msg->env->subject));291 mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); 292 mutt_paddstr (W, NONULL (msg->env->subject)); 291 293 draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to); 292 mvprintw (HDR_FCC, 0, TITLE_FMT "%-*.*s", Prompts[HDR_FCC - 1], W, W, fcc); 294 mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]); 295 mutt_paddstr (W, fcc); 293 296 294 297 … … 332 335 buf[0] = 0; 333 336 rfc822_write_address (buf, sizeof (buf), *addr); 334 mvprintw (line, HDR_XOFFSET, "%-*.*s", W, W, buf); 337 move (line, HDR_XOFFSET); 338 mutt_paddstr (W, buf); 335 339 336 340 return 0; … … 386 390 { 387 391 char buff[SHORT_STRING]; 392 iconv_t cd; 388 393 389 394 if (!mutt_is_text_type (b->type, b->subtype)) … … 397 402 if (mutt_get_field (_("Enter character set: "), buff, sizeof(buff), 0) == -1) 398 403 return 0; 399 400 if (mutt_is_utf8(buff)) 401 { 402 if (!b->noconv) 403 { 404 mutt_error (_("UTF-8 encoding attachments has not yet been implemented.")); 405 return 0; 406 } 407 } 408 else if (mutt_get_charset (buff) == NULL) 404 405 if ((cd = iconv_open (buff, "us-ascii")) == (iconv_t)-1) 409 406 { 410 407 mutt_error (_("Character set %s is unknown."), buff); 411 408 return 0; 412 409 } 410 else 411 iconv_close (cd); 413 412 414 413 mutt_set_body_charset (b, buff); … … 489 488 clrtoeol (); 490 489 if (msg->env->subject) 491 printw ("%-*.*s", W,W, msg->env->subject);490 mutt_paddstr (W, msg->env->subject); 492 491 } 493 492 break; … … 501 500 strfcpy (fcc, buf, _POSIX_PATH_MAX); 502 501 mutt_pretty_mailbox (fcc); 503 mvprintw (HDR_FCC, HDR_XOFFSET, "%-*.*s", W, W, fcc); 502 move (HDR_FCC, HDR_XOFFSET); 503 mutt_paddstr (W, fcc); 504 504 fccSet = 1; 505 505 } … … 766 766 break; 767 767 } 768 if (mutt_is_utf8 (mutt_get_parameter ("charset", CURRENT->parameter)))769 {770 mutt_error (_("We currently can't encode to utf-8."));771 break;772 }773 768 CURRENT->noconv = !CURRENT->noconv; 774 769 if (CURRENT->noconv)
