Bug 28913 - Content-Type not working properly
Summary: Content-Type not working properly
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Mailer Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2004-05-11 20:18 UTC by Daniel Marques Oliveira
Modified: 2009-11-29 19:40 UTC (History)
0 users

Patch against SendTag 1.19 for subject's char encoding (395 bytes, patch)
2004-05-14 12:14 UTC, Marc Guillemot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Marques Oliveira 2004-05-11 20:18:52 UTC
There are two problems when the user assign the content-type of the message

1. The subject of the message is set without specifying the charset (see 
message.setSubject(myparent.getSubject()) on the SendTag file).

2. The charset property of the MailTag is overriden always by the message tag, 
even in the case that where the charset is set to null (see myparent.setCharset
(charset), on de MessageTag file).

These two problems causes the subject of the message to appear human unreadible 
on the messages with foreign charset (like ISO-8859-1), on some mail clients 
programs, like Eudora.

I fixed up adding the charset to the subject, and adding a new taglib charset
(just in the case that I want to load up the charset from a bean or something 
like this), just like the other tags (from, server etc), where you say the 
fields in the parameter of the taglib, or in a separate taglib.
Comment 1 Marc Guillemot 2004-05-12 07:15:20 UTC
What about using the current response's charset if no charset is specified? I
guess that in most of the cases it would be the right one.
Comment 2 Marc Guillemot 2004-05-14 12:13:54 UTC
Daniel, thanks for your bug report, I've found that I had the same problem.

For my part it appears only for the subject, for instance when the default
charset is ASCII (under linux setting LANG=C before starting Tomcat), a subject
comes as:

The characters like ä, ö, ü etc contained in the body of the message are
displayed correctly (eg using Mozilla mailer v1.5).

For my part I've solved this setting the email's subject using the current
response's char encoding in SendTag. I attach this (simple) patch.
Comment 3 Marc Guillemot 2004-05-14 12:14:58 UTC
Created attachment 11546 [details]
Patch against SendTag 1.19 for subject's char encoding
Comment 4 Henri Yandell 2009-11-29 19:40:14 UTC
Resolving. Taglib has been retired.