Bug 18614

Summary: charset support
Product: Taglibs Reporter: Vit Timchishin <tivv>
Component: Mailer TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: All   

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 ***