1.1 --- a/WebStack/BaseHTTPRequestHandler.py Tue Aug 31 18:28:41 2004 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Wed Sep 01 22:51:40 2004 +0000
1.3 @@ -53,7 +53,7 @@
1.4
1.5 self.trans.send_response(self.response_code)
1.6 if self.content_type is not None:
1.7 - self.trans.send_header("Content-Type", self.format_content_type(self.content_type))
1.8 + self.trans.send_header("Content-Type", str(self.content_type))
1.9
1.10 for header, value in self.headers_out.items():
1.11 self.trans.send_header(self.format_header_value(header), self.format_header_value(value))
1.12 @@ -212,7 +212,7 @@
1.13 or a plain string (representing a file upload form field, for example).
1.14 """
1.15
1.16 - encoding = encoding or self.get_content_type().charset or "iso-8859-1"
1.17 + encoding = encoding or self.get_content_type().charset or self.default_charset
1.18
1.19 if self.storage_body is None:
1.20 self.storage_body = FieldStorage(fp=self.get_request_stream(), headers=self.get_headers(),
1.21 @@ -277,12 +277,12 @@
1.22 """
1.23
1.24 # Return a stream which is later emptied into the real stream.
1.25 - # Unicode can upset this operation. Using either the specified charset,
1.26 - # the same charset as that used in the request, or a default encoding.
1.27 + # Unicode can upset this operation. Using either the specified charset
1.28 + # or a default encoding.
1.29
1.30 - encoding = self.get_content_type().charset or "utf-8"
1.31 if self.content_type:
1.32 - encoding = self.content_type.charset or encoding
1.33 + encoding = self.content_type.charset
1.34 + encoding = encoding or self.default_charset
1.35 return ConvertingStream(self.content, encoding)
1.36
1.37 def get_response_code(self):