Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51642

Re: email 8bit encoding

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <antoon.pardon@rece.vub.ac.be>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status UNSURE 0.221
X-Spam-Level **
X-Spam-Evidence '*H*': 0.69; '*S*': 0.13; 'encoded': 0.07; 'utf-8': 0.07; 'python': 0.11; 'how,': 0.16; 'trying': 0.19; 'header:User- Agent:1': 0.23; 'module,': 0.24; 'header:In-Reply-To:1': 0.27; '3.2': 0.31; 'skip:m 30': 0.32; 'could': 0.34; 'test': 0.35; 'but': 0.35; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'email addr:yahoo.com': 0.64; 'pardon': 0.84; 'received:195.238': 0.84; 'received:195.238.6': 0.84; 'received:belgacom.be': 0.84; 'received:isp.belgacom.be': 0.84; '8bit': 0.91
X-Belgacom-Dynamic yes
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result AhIDANLU9lFbtq+i/2dsb2JhbAANToZUqHaSGQQEAYEwgxkBAQQ4QBELIRYPCQMCAQIBMxIQAwYCAod6A6YyikyIB40VgSmBRhaDcQOVeoFljCaIPIFv
Date Mon, 29 Jul 2013 22:52:04 +0200
From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130704 Icedove/17.0.7
MIME-Version 1.0
To python-list@python.org
Subject Re: email 8bit encoding
References <36aa5535-a821-4d7e-8414-1e40820705e4@googlegroups.com>
In-Reply-To <36aa5535-a821-4d7e-8414-1e40820705e4@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Mailman-Approved-At Wed, 31 Jul 2013 14:07:43 +0200
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12.1375272464.1251.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375272464 news.xs4all.nl 15891 [2001:888:2000:d::a6]:49378
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:51642

Show key headers only | View raw


Op 29-07-13 01:41, rurpy@yahoo.com schreef:
> How, using Python-3.3's email module, do I "flatten" (I think
> that's the right term) a Message object to get utf-8 encoded
> body with the headers:
>   Content-Type: text/plain; charset=UTF-8
>   Content-Transfer-Encoding: 8bit
> when the message payload was set to a python (unicode) string?
>

I am just trying out some things for my self on python 3.2 so
be sure to test this out but you could try the following.

msg.set_charset('utf-8')
msg['Content-Transfer-Encoding'] = '8bit'

-- 
Antoon Pardon

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

email 8bit encoding rurpy@yahoo.com - 2013-07-28 16:41 -0700
  Re: [python] email 8bit encoding "W. Trevor King" <wking@tremily.us> - 2013-07-28 23:16 -0700
    Re: [python] email 8bit encoding rurpy@yahoo.com - 2013-07-29 20:56 -0700
  Re: email 8bit encoding Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-07-29 22:52 +0200
    Re: email 8bit encoding rurpy@yahoo.com - 2013-08-01 08:20 -0700
      Re: email 8bit encoding Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-02 13:19 +0200
      Re: email 8bit encoding Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-02 14:12 +0200

csiph-web