diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-17 14:23:24 +0800 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-17 14:23:24 +0800 |
commit | dfd1579e54a431333cdcaaa2df82c13f135caff9 (patch) | |
tree | 058deae03a6c21a9e1479e821bcb21fb776facf6 /Lib | |
parent | 3ae81137c8b8dc93ebdf846e1224150012040b75 (diff) | |
parent | 3853586e0caa0d5c4342ac8bd7e78cb5766fa8cc (diff) | |
download | cpython-git-dfd1579e54a431333cdcaaa2df82c13f135caff9.tar.gz |
merge from 2.5 branch.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/SimpleHTTPServer.py | 4 |
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 |