| | 389 | static int change_attachment_charset (BODY *b) |
| | 390 | { |
| | 391 | char buff[SHORT_STRING]; |
| | 392 | |
| | 393 | if (b->type != TYPETEXT) |
| | 394 | { |
| | 395 | mutt_error _("Can't change character set for non-text attachments!"); |
| | 396 | return 0; |
| | 397 | } |
| | 398 | |
| | 399 | mutt_get_send_charset (buff, sizeof(buff), b, 0); |
| | 400 | |
| | 401 | if (mutt_get_field (_("Enter character set: "), buff, sizeof(buff), 0) == -1) |
| | 402 | return 0; |
| | 403 | |
| | 404 | if (mutt_is_utf8(buff)) |
| | 405 | { |
| | 406 | mutt_error (_("UTF-8 encoding attachments has not yet been implemented.")); |
| | 407 | return 0; |
| | 408 | } |
| | 409 | |
| | 410 | if (mutt_get_charset (buff) == NULL) |
| | 411 | { |
| | 412 | mutt_error (_("Character set %s is unknown."), buff); |
| | 413 | return 0; |
| | 414 | } |
| | 415 | |
| | 416 | mutt_set_body_charset (b, buff); |
| | 417 | return REDRAW_CURRENT; |
| | 418 | } |
| | 759 | case OP_COMPOSE_CHANGE_CHARSET: |
| | 760 | CHECK_COUNT; |
| | 761 | menu->redraw = change_attachment_charset(idx[menu->current]->content); |
| | 762 | break; |
| | 763 | |
| | 764 | case OP_COMPOSE_NORECODE: |
| | 765 | CHECK_COUNT; |
| | 766 | if (idx[menu->current]->content->type != TYPETEXT) |
| | 767 | { |
| | 768 | mutt_error (_("Recoding only affects text/plain attachments.")); |
| | 769 | break; |
| | 770 | } |
| | 771 | idx[menu->current]->content->noconv = !idx[menu->current]->content->noconv; |
| | 772 | if (idx[menu->current]->content->noconv) |
| | 773 | mutt_message (_("The current attachment won't be converted.")); |
| | 774 | else |
| | 775 | mutt_message (_("The current attachment will be converted.")); |
| | 776 | menu->redraw = REDRAW_CURRENT; |
| | 777 | break; |
| | 778 | |