[TYPO3-core] RFC: Fix charset encoding in TYPO3 mails (not only direct_mail)

Michael Stucki michael at typo3.org
Wed Jan 25 10:07:57 CET 2006


This is a CVS patch request.

Problem:
TYPO3 does not respect the site character set but announces all of them as
iso-8859-1 instead.

Solution:
Teach it to learn about different charsets.

Comments:

1. t3lib_div::plainMailEncoded(): The parameter $dontEncodeSubject has been
replaced by $dontEncodeHeader. Works more consistently.

2. Default output of this function is now 'quoted-printable'. Afaik it makes
no sense to send non-QPencoded 7bit messages (that was the old default
setting) because this would crop some of the mail contents.

3. The new function t3lib_div::encodeHeader() is mainly needed to find email
addresses which must stay 7bit in all cases. It splits the headers line by
line, preserves found email addresses with a special wrap, and encodes all
other parts.

4. The charset detection in class.t3lib_dmailer.php was written by Bernhard
(kb_mailcs). Works absolutely perfect but is not needed anymore after this
patch.

5. Other than Stanislas' patch before, my version uses chr(10) linebreaks
when it writes the charset headers. This probably needs to be changed, I'm
waiting for Stanislas' comment here.


I have also attached a 2nd patch in which I modified the way how the install
tool sends plain-text test mails. Instead of using mail() it will now use
t3lib_div::plainMailEncoded().

Additionally, the 2nd patch fixes the problem that $this->messages was not
visible on foreign hosts because debug() was used. Now it prints these
comments using t3lib_div::debug() which means, everybody will see the
messages.


Final notice: I have this patch working on many utf8 websites. It is working
absolutely perfect, so there should be no problems with this patch.

Regards, michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: installTool_testmails.diff
Type: text/x-diff
Size: 2764 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060125/c15c65e5/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utf8_mails.diff
Type: text/x-diff
Size: 13923 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060125/c15c65e5/attachment-0001.bin 


More information about the TYPO3-team-core mailing list