# HG changeset patch # User paulb # Date 1093890240 0 # Node ID a451f549b73dd8c85cc846600ce1df3524ef6d04 # Parent 53bb6caa685f864e9c59d89b38d1405f7e722f2f [project @ 2004-08-30 18:24:00 by paulb] Added a default charset to ContentType. This should avoid many accidental UnicodeError situations - developers might now only encounter such things when setting inappropriate charsets. diff -r 53bb6caa685f -r a451f549b73d WebStack/Generic.py --- a/WebStack/Generic.py Sun Aug 29 22:46:29 2004 +0000 +++ b/WebStack/Generic.py Mon Aug 30 18:24:00 2004 +0000 @@ -20,8 +20,16 @@ "A container for content type information." def __init__(self, content_type, charset=None, attributes=None): + + """ + Initialise the container with the given principal 'content_type', an + optional 'charset' (which otherwise uses "utf-8" as default), and + optional 'attributes' (a list of 2-tuples each representing the + key=value pairs which qualify content types). + """ + self.content_type = content_type - self.charset = charset + self.charset = charset or "utf-8" self.attributes = attributes class Transaction: