Mails & encoding

L

Lord Eldritch

I have a CGI written in Python to process a form a read/write a text file (a
minimal database). It runs in a Linux box with and it looks all the encoding
is UTF8. Now I have two questions:

- When I have:

ttext='áááááááááá'

I get a warning sendinme to this page

http://www.python.org/peps/pep-0263.html

Should I understand that PEP has been already implemented and follow it?

- Related to the former one: the CGI sends an email with stress marks and
other characters. I can read it with out any problem in my Kmail client
because it detects the encoding. But I saw that most of the users are gonna
read it in a webmail service where the characters (UTF8) are not recognized.
Can I force a encoding when I send an email? kind of:

mail(adress,'My title', mytext.encode'iso9865')


Thanks in advance.
 
G

Gabriel Genellina

En Sun, 20 Dec 2009 07:46:02 -0300, Lord Eldritch
I have a CGI written in Python to process a form a read/write a text
file (a
minimal database). It runs in a Linux box with and it looks all the
encoding is UTF8. [...]
- Related to the former one: the CGI sends an email with stress marks and
other characters. I can read it with out any problem in my Kmail client
because it detects the encoding. But I saw that most of the users are
gonna
read it in a webmail service where the characters (UTF8) are not
recognized.
Can I force a encoding when I send an email? kind of:

mail(adress,'My title', mytext.encode'iso9865')

Yes, you can, and you should. Make sure the Content-Type (and probably
Content-Transfer-Encoding too) header fields are correct. How to set them,
depends on how you build the email to be sent (and the Python version in
use).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top