create plain-text mail with html and utf encoded characters

6 views
Skip to first unread message

Markus S.

unread,
Mar 20, 2007, 5:34:37 AM3/20/07
to mimemessage-dev
Hi all,
I do have certain textstrings hardcoded and also textelements, which
come from a textarea element of a form.
I want to create a plain-text mail, which shows all characters
correct. This works for ASCII characters but not for certain
characters of east-european languages.
Sample:
If someone posts:
Máte dotaz k určitému článku nebo na jiné téma? Jsme rádi za Vaši
odezvu.

The html (Content-Type: text/plain; charset=ISO-8859-1) looks like:
M=E1te dotaz k určit=E9mu čl=E1nku nebo na jin=E9 t=E9ma?

All UTF-8 coded signs are displayed encoded, not real.

How do I send a email with correct displayed UTF-8 signs, when they
are available only encoded (&#...) in php?

Thanks a lot for your help.

Manuel Lemos

unread,
Mar 21, 2007, 7:53:52 PM3/21/07
to mimemes...@googlegroups.com
Hello,

on 03/20/2007 06:34 AM Markus S. said the following:

I think first you need to use the same character encoding in the page on
which you enter your form. Add this in the page head section:

<meta http-equiv="content-type" content="text/html; charset=utf-8">

Than you need to set your message to use utf-8 by default by setting the
default_charset varaiable of the class to 'utf-8'.

Look at the script test_multibyte_message.php for a complete example of
how to do this. It uses Japanese character set encoding. Just change
ISO-2022-JP to utf-8 .

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Reply all
Reply to author
Forward
0 new messages