1.1 --- a/WebStack/BaseHTTPRequestHandler.py Mon Sep 06 21:36:02 2004 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Sun Sep 12 18:08:18 2004 +0000
1.3 @@ -329,10 +329,20 @@
1.4 # Unicode can upset this operation. Using either the specified charset
1.5 # or a default encoding.
1.6
1.7 + encoding = self.get_response_stream_encoding()
1.8 + return ConvertingStream(self.content, encoding)
1.9 +
1.10 + def get_response_stream_encoding(self):
1.11 +
1.12 + """
1.13 + Returns the response stream encoding.
1.14 + """
1.15 +
1.16 if self.content_type:
1.17 encoding = self.content_type.charset
1.18 - encoding = encoding or self.default_charset
1.19 - return ConvertingStream(self.content, encoding)
1.20 + else:
1.21 + encoding = None
1.22 + return encoding or self.default_charset
1.23
1.24 def get_response_code(self):
1.25