summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2011-03-17 14:23:24 +0800
committerSenthil Kumaran <orsenthil@gmail.com>2011-03-17 14:23:24 +0800
commitdfd1579e54a431333cdcaaa2df82c13f135caff9 (patch)
tree058deae03a6c21a9e1479e821bcb21fb776facf6 /Lib
parent3ae81137c8b8dc93ebdf846e1224150012040b75 (diff)
parent3853586e0caa0d5c4342ac8bd7e78cb5766fa8cc (diff)
downloadcpython-git-dfd1579e54a431333cdcaaa2df82c13f135caff9.tar.gz
merge from 2.5 branch.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleHTTPServer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index 0110da0181..3e0334da3b 100644
--- a/Lib/SimpleHTTPServer.py
+++ b/Lib/SimpleHTTPServer.py
@@ -15,6 +15,7 @@ import posixpath
import BaseHTTPServer
import urllib
import cgi
+import sys
import shutil
import mimetypes
try:
@@ -131,7 +132,8 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
length = f.tell()
f.seek(0)
self.send_response(200)
- self.send_header("Content-type", "text/html")
+ encoding = sys.getfilesystemencoding()
+ self.send_header("Content-type", "text/html; charset=%s" % encoding)
self.send_header("Content-Length", str(length))
self.end_headers()
return f