Bug 18614 - charset support
Summary: charset support
Status: RESOLVED DUPLICATE of bug 23858
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Mailer Taglib (show other bugs)
Version: 1.1
Hardware: PC All
: P3 major with 3 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-02 15:37 UTC by Vit Timchishin
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vit Timchishin 2003-04-02 15:37:49 UTC
Current charset support is awful. It tries to encode header, but fails( at least
none of my mailers could parse such a header ) and encodes body as latin1
(giving "?" chars instead of all other characters).
I've tried to do next change to SendTag.java:
            try {
                // set the message with a mimetype according to type set by user
                String tp = myparent.getType();
                if ("text/plain".equals(tp))
                    message.setText(myparent.getBody());
                else
                        message.setContent(myparent.getBody(), tp);
            } catch (MessagingException me) {
                // this error is not very likely to occur
                throw new JspException("The message could not be set in " +
                                   "the e-mail, please back up and try again.");
            }
but it did not help. For now  I use 
            try {
                // set the message with a mimetype according to type set by user
                String tp = myparent.getType();
                if ("text/plain".equals(tp))
                    message.setText(myparent.getBody(), "KOI8-R");
                else
                        message.setContent(myparent.getBody(), tp);
            } catch (MessagingException me) {
                // this error is not very likely to occur
                throw new JspException("The message could not be set in " +
                                   "the e-mail, please back up and try again.");
            }

, but this fixes charset. May be we can add charset parameter to some tag to
allow selecting any charset?
Comment 1 Martin Cooper 2003-12-10 07:39:53 UTC
The titles of #18614 and #23858 do not seem related, but they are both issues 
resulting from the lack of ability to specify a character set for the message. 
Bug #23858 now includes patches to resolve that problem, so I'm marking this 
bug report as a duplicate of it.

*** This bug has been marked as a duplicate of 23858 ***