A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-April/088655.html below:

[Python-Dev] email header encoding

[Python-Dev] email header encoding [Python-Dev] email header encodingChris Withers chris at simplistix.co.uk
Sat Apr 11 14:33:33 CEST 2009
Stephen J. Turnbull wrote:
> Robert Brewer writes:
> 
>  > Syntactically, there's no sense in providing:
>  > 
>  >     Message.set_header('Subject', 'Some text', encoding='utf-16')
>  > 
>  > ...since you could more clearly write the same as:
>  > 
>  >     Message.set_header('Subject', 'Some text'.encode('utf-16'))
> 
> Which you now must *parse* and guess the encoding to determine how to
> RFC-2047-encode the binary mush.  I think the encoding parameter is
> necessary here.

Indeed.

>  > But it would be far easier to do all the encoding at once in an
>  > output() or serialize() method. Do different headers need different
>  > encodings?
> 
> You can have multiple encodings within a single header (and a naïve

"can" and "should" are two very different things.
When is it even a good idea to have more than one encoding in a single 
header?

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4