durusmail: quixote-users: Re: Patch[1] for http_response.py for quixote-2.1
Patch[1] for http_response.py for quixote-2.1
2005-08-21
2005-08-21
2005-08-29
2005-08-29
Re: Patch[1] for http_response.py for quixote-2.1
2005-08-29
2005-08-29
2005-09-01
behavior of set_content_type()
Re: behavior of set_content_type()
2005-08-30
2005-08-30
2005-08-30
Re: Patch[1] for http_response.py for quixote-2.1
Hamish Lawson
2005-09-01
Neil Schemenauer wrote:

> DEFAULT_STR_CHARSET is for insane  people who think
> that str instances should contain encoded character data.

I couldn't decide if I was one of those insane people as I wasn't sure
what it was that you were taking a dig at! Internally a Python program
may deal only in unicode strings, but these must still be serialised
to a bytestream (str) if they need to make their way in or out of the
program , yes? It wasn't "encoded" that you were referring to? Please
reassure me that you aren't a victim to the fallacy that str instances
could possibly contain *unencoded* character data! (As Joel Spolsky
explains, "there ain't no such thing as plain text". [1])

> Also, people who use unicode can set it to 'ascii' and ensure that
> http_response._decode_string() always returns unicode strings.

Will doing this always return a unicode string? If the input string
has bytes higher than 0x7F, won't decoding with the "ascii" codec
raise a UnicodeDecodeError?

[1] "The Absolute Minimum Every Software Developer Absolutely,
Positively Must Know About Unicode and Character Sets (No Excuses!)"



Hamish
reply